[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - sw/source sysui/desktop

Armin Le Grand alg at apache.org
Thu Jul 3 07:10:17 PDT 2014


 sw/source/core/doc/notxtfrm.cxx  |   55 ++++++++++++++++++++++++++++++++++-----
 sysui/desktop/debian/control     |    3 +-
 sysui/desktop/debian/makefile.mk |    2 -
 3 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 131669af7168020750b726e4e6d1568975f73886
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Jul 3 13:58:29 2014 +0000

    i125171 support lossless embedding of linked jpegs in writer for PDF export

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index d96023a..a988b36 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1006,13 +1006,54 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
                         basegfx::tools::createScaleTranslateB2DHomMatrix(
                             aTargetRange.getRange(),
                             aTargetRange.getMinimum()));
-                    drawinglayer::primitive2d::Primitive2DSequence aContent;
-
-                    aContent.realloc(1);
-                    aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
-                        aTargetTransform,
-                        rGrfObj.GetGraphic(),
-                        aGrfAttr);
+                    drawinglayer::primitive2d::Primitive2DSequence aContent(1);
+                    bool bDone(false);
+
+                    // #i125171# The mechanism to get lossless jpegs into pdf is based on having the original
+                    // file data (not the bitmap data) at the Graphic in the GfxLink (which has *nothing* to
+                    // do with the graphic being linked). This works well for DrawingLayer GraphicObjects (linked
+                    // and unlinked) but fails for linked Writer GraphicObjects. These have the URL in the
+                    // GraphicObject, but no GfxLink with the original file data when it's a linked graphic.
+                    // Since this blows up PDF size by a factor of 10 (the graphics get embedded as pixel maps
+                    // then) it is okay to add this workarund: In the needed case, load the graphic in a way to
+                    // get the GfxLink in the needed form and use that Graphic temporarily. Do this only when
+                    // - we have PDF export
+                    // - the GraphicObject is linked
+                    // - the Graphic has no GfxLink
+                    // - LosslessCompression is activated
+                    // - it's indeed a jpeg graphic (could be checked by the url ending, but is more reliable to check later)
+                    // In all other cases (normal repaint, print, etc...) use the available Graphic with the
+                    // already loaded pixel graphic as before this change.
+                    if(pOut->GetExtOutDevData() && rGrfObj.HasLink() && !rGrfObj.GetGraphic().IsLink())
+                    {
+                        const vcl::PDFExtOutDevData* pPDFExt = dynamic_cast< const vcl::PDFExtOutDevData* >(pOut->GetExtOutDevData());
+
+                        if(pPDFExt && pPDFExt->GetIsLosslessCompression())
+                        {
+                            Graphic aTempGraphic;
+                            INetURLObject aURL(rGrfObj.GetLink());
+
+                            if(GRFILTER_OK == GraphicFilter::GetGraphicFilter()->ImportGraphic(aTempGraphic, aURL))
+                            {
+                                if(aTempGraphic.IsLink() && GFX_LINK_TYPE_NATIVE_JPG == aTempGraphic.GetLink().GetType())
+                                {
+                                    aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+                                        aTargetTransform,
+                                        aTempGraphic,
+                                        aGrfAttr);
+                                    bDone = true;
+                                }
+                            }
+                        }
+                    }
+
+                    if(!bDone)
+                    {
+                        aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+                            aTargetTransform,
+                            rGrfObj.GetGraphic(),
+                            aGrfAttr);
+                    }
 
                     paintUsingPrimitivesHelper(
                         *pOut,
commit 90a3fb5a924cb16e3b2c05b2ac9d4cd6bd32d504
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Jul 3 12:50:04 2014 +0000

    #i125176# add Debian package maintainer and extended description
    
    the package maintainer is a to-be-created email alias to the target that
    will be decided by the Apache OpenOffice PMC.

diff --git a/sysui/desktop/debian/control b/sysui/desktop/debian/control
index 90f0c09..75f9191 100644
--- a/sysui/desktop/debian/control
+++ b/sysui/desktop/debian/control
@@ -1,5 +1,6 @@
 Description: %productname desktop integration
-Maintainer: Apache Software Foundation
+ This package provides desktop icons and menus for %productname
+Maintainer: Apache Software Foundation <packagers at openoffice.apache.org>
 Architecture: all
 Provides: openoffice-desktop-integration, openoffice.org-unbundled
 Conflicts: openoffice-desktop-integration, openofficeorg-desktop-integration, openoffice.org-debian-menus
commit 8c424ee978f5ea027289391332b1daab173b084b
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Jul 3 12:35:27 2014 +0000

    #i125176# fix the Debian control-file-bad-permission problem

diff --git a/sysui/desktop/debian/makefile.mk b/sysui/desktop/debian/makefile.mk
index a0616c8..30d886c 100644
--- a/sysui/desktop/debian/makefile.mk
+++ b/sysui/desktop/debian/makefile.mk
@@ -81,7 +81,7 @@ $(DEBFILES) : makefile.mk control postinst postrm prerm
     -$(RM) $(@:d)$(@:f:s/_/ /:1)_*
     $(RM) -r $(MISC)$/$(@:b)
     dmake $(MISC)$/$(@:b)$/DEBIAN$/{control postinst postrm prerm} 
-    @chmod -R o-w $(MISC)$/$(@:b)
+    @chmod -R go-w $(MISC)$/$(@:b)
     @chmod a+rx $(MISC)$/$(@:b)$/DEBIAN $(MISC)/$(@:b)/DEBIAN/post* $(MISC)/$(@:b)/DEBIAN/pre*
     @chmod g-s $(MISC)/$(@:b)/DEBIAN
     @mkdir -p $(PKGDIR)


More information about the Libreoffice-commits mailing list