[Libreoffice-commits] core.git: sd/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Mar 13 03:52:19 UTC 2018


 sd/source/filter/eppt/epptbase.hxx  |    8 +++++---
 sd/source/filter/eppt/epptso.cxx    |    9 +++++----
 sd/source/filter/eppt/pptx-text.cxx |   29 ++++++++++-------------------
 3 files changed, 20 insertions(+), 26 deletions(-)

New commits:
commit e22e4f75e4af2cb2fc041eef6f0178a4941285da
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon Mar 12 17:10:52 2018 +0900

    sd: bullet graphic uses "Graphic" prop. instead "GraphicURL"
    
    Change-Id: Iab5b10ae1887c1ea7149bb4ba09ba9e913985398
    Reviewed-on: https://gerrit.libreoffice.org/51106
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx
index 76f45a490da4..2f726f3c6925 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -33,8 +33,10 @@
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/presentation/FadeEffect.hpp>
 #include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
 #include <vcl/vclptr.hxx>
 #include <vcl/virdev.hxx>
+#include <vcl/graph.hxx>
 
 #include "grouptable.hxx"
 
@@ -122,10 +124,10 @@ class PPTExBulletProvider
 
     public:
 
-        sal_uInt16              GetId( const OString& rUniqueId, Size& rGraphicSize );
+        sal_uInt16 GetId(Graphic const & rGraphic, Size& rGraphicSize);
 
-                                PPTExBulletProvider();
-                                ~PPTExBulletProvider();
+        PPTExBulletProvider();
+        ~PPTExBulletProvider();
 };
 
 struct FontCollectionEntry
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 53ce26cfce89..632371f74ff0 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -37,6 +37,7 @@
 #include <sot/storage.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/virdev.hxx>
+#include <vcl/graph.hxx>
 #include <sfx2/app.hxx>
 #include <svl/languageoptions.hxx>
 #include <editeng/svxenum.hxx>
@@ -104,14 +105,14 @@ PPTExBulletProvider::~PPTExBulletProvider()
 {
 }
 
-sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicSize )
+sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSize )
 {
     sal_uInt16 nRetValue = 0xffff;
 
-    if ( !rUniqueId.isEmpty() )
+    if (rGraphic)
     {
-        std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(rUniqueId));
-        Graphic         aMappedGraphic, aGraphic(xGraphicObject->GetGraphic());
+        Graphic         aMappedGraphic, aGraphic(rGraphic);
+        std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(aGraphic));
         Size            aPrefSize( aGraphic.GetPrefSize() );
         BitmapEx        aBmpEx( aGraphic.GetBitmapEx() );
 
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index 2f80dbd7f7de..a01e263f2804 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -53,6 +53,8 @@
 #include <vcl/virdev.hxx>
 #include <o3tl/make_unique.hxx>
 
+using namespace css;
+
 static css::uno::Reference< css::i18n::XBreakIterator > xPPTBreakIter;
 
 PortionObj::PortionObj(const css::uno::Reference< css::beans::XPropertySet > & rXPropSet,
@@ -817,7 +819,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
                 nBulletRealSize = 100;
                 nMappedNumType = 0;
 
-                OUString aGraphicURL;
+                uno::Reference<graphic::XGraphic> xGraphic;
                 for ( sal_Int32 i = 0; i < nPropertyCount; i++ )
                 {
                     OUString aPropName( pPropValue[ i ].Name );
@@ -843,8 +845,8 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
                             aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
 
                     }
-                    else if ( aPropName == "GraphicURL" )
-                        aGraphicURL = *o3tl::doAccess<OUString>(pPropValue[i].Value);
+                    else if ( aPropName == "Graphic" )
+                        xGraphic = pPropValue[i].Value.get<uno::Reference<graphic::XGraphic>>();
                     else if ( aPropName == "GraphicSize" )
                     {
                         if (auto aSize = o3tl::tryAccess<css::awt::Size>(pPropValue[i].Value))
@@ -887,25 +889,14 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
 #endif
                 }
 
-                if ( !aGraphicURL.isEmpty() )
+                if (xGraphic.is())
                 {
                     if ( aBuGraSize.Width() && aBuGraSize.Height() )
                     {
-                        sal_Int32 nIndex = aGraphicURL.indexOf(':');
-                        if ( nIndex != -1 )
-                        {
-                            nIndex++;
-                            if ( nIndex < aGraphicURL.getLength() )
-                            {
-                                OString aUniqueId( OUStringToOString(aGraphicURL.copy(nIndex), RTL_TEXTENCODING_UTF8) );
-                                if ( !aUniqueId.isEmpty() )
-                                {
-                                    nBulletId = pBuProv->GetId( aUniqueId, aBuGraSize );
-                                    if ( nBulletId != 0xffff )
-                                        bExtendedBulletsUsed = true;
-                                }
-                            }
-                        }
+                        Graphic aGraphic(xGraphic);
+                        nBulletId = pBuProv->GetId(xGraphic, aBuGraSize );
+                        if ( nBulletId != 0xffff )
+                            bExtendedBulletsUsed = true;
                     }
                     else
                     {


More information about the Libreoffice-commits mailing list