 through a privilege back in impress and you more specific specifically it will be about files produced by PowerPoint and They are in through a privilege if it's impress So who am I? quick Description and I'm so practically I go by QX QX in the IRC most of the time and and I was a Google summer of cost to do students in 2020 and I've done physics based animation effects for impress Right now, I'm still studying at Istanbul Technical University I'm an electronics and communication engineering student there and we have a club there I served as chair of it for two terms right now I'm also an intern of collaborative productivity So let's begin. What are the rough steps for fixing an interoperability bug? firstly, I Think the most important part is understanding the problem and the bug because this can be really complicated then it looks on the surface most of the time and Then of course we come up with a proposed fix that we'd like to implement how it would behave if it was working right and we try to do that most of the time These two steps are kind of interlinked and we go between that a new proposed fix try to implement it and if that doesn't work, of course anyone and Lastly when we are done to ensure that this stay Our work Keeps working we implement test for it and that's quite important to So let's start with an import bug from a PPTX file We need to understand the bug first so we are going to go through the bug report and so most of the time titles of the bug reports are quite misleading and Because they just in a short Santas try to describe what went wrong they most of the time It is not possible to get it right most of the time so after that there's a description and Comments I think the most important part usually if it's a populated bug is the comments there are lots if you are lucky you can find lots of know-how there of Other QA engineers were going through the document and giving tips and stuff so look out for that Here I picked an example bug That's about Image color appearing wrong and that is a title But obviously this doesn't really describe the technical problem with the bug It's just any there's an image and it opens wrong and there are lots of Attachments I like to talk about them Right now because I really love them when someone actually sends a bug report and also includes Comparison images with it. It's really easy to understand situation better just before Of course, there are also the versioned ones because LibreOffice gets constantly updated and if this is an archaic bug We can just look at how it was when it was initially reported for 5.2 and how it is now and we can actually compare those so if you do that, I really love it So indicating the bug documents the most important resource are the bug documents that are in the attachment and For import We need to compare How it was actually appearing in PowerPoint in the Constitution and how it is in impress We need to try to reproduce the problematic part in PowerPoint How we do that can differ if you can find how it was actually done through the PowerPoint point UI It is better because we can create lots of variations of it because most of the time when we are working with Office software doing one thing can be done a lot of different ways If you want to say something transparent for instance, you can set the text transparent set the whole Box transparent. Maybe it's a group shape. We can make the group shape transparent so there are lots of ways of achieving the same thing if we understand it how the user actually initially approached it it is better and And finally after Usually doing this is I think more the most important part if you can't do that Exploring the produce file on the pin on the pinnets and proofs in the context. We will have to do that anyway and For instance for the bug case that I just showed here The attached images showed that This is how it appeared on PowerPoint and this is how it appeared on impress and when we look through zip and The pictures themselves they are actually look how it looks on they actually look how it looks on impress so looking at this Before starting anything I'd like to isolate the problematic part Because for instance this graphic is actually the same with PowerPoint On impress so I just for instance decided to focus on this graphic And to do that you just create a new blank PowerPoint document just copied and pasted over so that you have a clean document with two problematic piece and My first assumption looking at these photos alone was PowerPoint was applying some kind of color effect to it and And most likely impress didn't actually have a similar thing But later, okay, not but yet. I'm ahead of myself. So Then after isolating the piece I save the document look through its contents by on the pinnets or some Other way and we go to the slide contents and we can find That there is this bi level tag Which means I believe binary level and it's specifies a black and white effect to the image Also, there is an accompanying threshold value and After finding this my hunch was still That power impress doesn't have this black and white effect implemented So we just can't import it probably or something like that because I didn't know about stuff. Okay then I Look through the UI of PowerPoint and Look, where could I apply this black and white effect and I found it in picture format color and It was under recolor. So these three elements are actually black and white Color effects and it goes through 25 percent five fifty percent the 75 percent So there are only three options for it so I went ahead and Copied the same picture over three times and applied 25 percent for one 50 percent for one and 75 percent for the last one and This is how it looks when I reopen it When I open it in PowerPoint and I later I Saved this and open this in impress and all of them were black So I was like, okay my hunch was really correct and I was going the right way So there is no black and white effect implemented. Maybe import of it is not implemented But I thought I was in the right way. So after that I Wanted to check if these tokens or XML tags were even considered during import So to do that, I just grabbed through o x o x source drawing ML for bi level take and I found it actually I didn't expect This to be there because that nothing was happening. So I went through and Chased what happens to the color effect later Found it's here and it was it's doing something called color mode and color what mono was defined. So most likely Actually Impressed had some way of applying the Monochrome or binary level all black and white effect. There are lots of names for it. It appears and Realizing this okay Sorry So I thought Okay, actually there is import of binary level But we don't see any import of threshold values here. So maybe if I implemented that should be okay so I started to come up with a proposed fix and And So back reason van coming up with a proposed fix bug reasons might be no implement report non-existent feature no straight Forward way of mapping the feature because sometimes two features might mean and another single feature in other software And and so for this case, let me just actually Go a little faster because not much time. There's not much time for the case with TDF 89928 the one with the colors Binary level effect I Try to implement the missing parts of the feature and so What I realized was I Went to impress and there was no way of defining any threshold values when we apply a color mode there So the feature mapping one to one was not going to work now We have two options here. We can go the generalized way which is which should be the best way to do it and Implement the missing parts of the feature then import then export done for ODP and other formats. Well, this is relatively hard to do and if this Feature isn't that much important It doesn't make sense to go through this So I actually went with the easy to implement way here because what I realized going through some code Around there was this was already being done for do-it-all transforms and Some change color transform effects. These effects were actually getting baked in during import time So turns out these or VCL had algorithms to Apply these effects But not really true UI or the document model So realizing that I decided to go with something similar to that and research and research to find if I could do the same for monochrome effect or binary level or black and white and I realized this filter defined in VCL It to my luck, it's already had a threshold defined to it and I Went ahead and let me just go ahead Try to implement the actual fix most of time PPTX imports stuff in OEX source PPT or X source drawing ML or on the OEX source and And first part of it was implementing the binary level threshold import and Of course, we shouldn't forget that used to before The color mode mono was working when it was exactly 50 percent. I forgot to mention that that's my bet Forgot to mention it while we were there but turns out When the threshold is actually 50% it is the same with the feature in impress so we can just Import this it as color mode mono and this gives out this doesn't destroy the information of the picture itself so we don't bake the effect in and We can keep the original picture and also the effect on top And so we need to implement a special case for this too because information loss Should be minimized if we can do that So it just checks if it's 50% and it doesn't do that if that's the case in an in any other case It's just bakes the effect in through using the monochrome filter So this is the Application part of the code it just gets the Graphic bitmap and the alpha mask and just applies it so lastly we implement we implement a test for it and When you are actually writing your test you don't have to just stay You don't have to just write it for what you have just fixed You can actually add some additions stuff that you think might break about some edge conditions it might be nice to add them too and this is an Example Code for import import test It's under STQA units Usually if it's an imported it should be under here and Actually, I had an export bug and some more stuff, but I guess I'm running out of time Is it okay So I Also wanted to give some example about an export bug and what are the differences with that? So again, we need to understand bug that's important here we have Automatic colors white on dark background or color spray define lots of questions there and it's important not exported to PPTX correctly and going through the but bug this was a lucky one because in the come command section Timur mentioned that upon testing found found out that automatic font color for word and Excel Exists but not for PowerPoint and turns out PowerPoint doesn't have automatic colors What automatic colors are by the way is If the background is dark It's just it is just white and if the background is light. It is just black so The bug report already tells us that word and Excel has automatic colors, but power paint doesn't So while we are coming up with a proposed fix Again, we can have two solutions generalized solution would be here General solution should always be sorry. This is the general case Not just for the report bug file and it should introduce the missing concept in its totality In this case We need to have some observations first And I already already talked about Call or auto being white or black whether the background black or white is dark or light. Sorry color auto only cares about slight background and shape fill in impress and it Prioritizes shape fill first then slight background which makes sense and I wasn't able to find anything else by testing impress myself, but What I actually wanted to do here was the generalized fix because if I'm just putting some new ifs upon my Upon what I realized testing on impress that might not hold up to do Hold up to time when stuff change around and auto color actually does something different So I wanted to find how does impress actually resolve color auto natively and export to resulting color and an easy the implements way of doing Not that but the fix for this buck would be Just taking the shape fill and slight background color so going export stuff pointers here if you want to take a look later and and Trying to do the generalized case what I realized what I grabbed some code and found out edit engine implementation actually has a get auto color function and Similarly VCL for font has gets color get color for the font and But the comments stated here. It is pretty much obsolete I Ended up trying to use them both, but none of them actually worked with the shape background Situation and VCL font get color already this stated that it is pretty much absolutely so color auto actually Most likely yes result during rendering. So I wasn't able to find what really happens there and port it over on the export side In this case Doing this the easy way I Added a check to make sure it was a PPTX document then add some special checks and export it it if it should have been white or black depending on the background colors And lastly of course I implemented some tests for it Checking the Pet on export Thank you all for listening to this talk