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

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Sun Feb 25 07:43:42 UTC 2018


 oox/source/ole/axcontrol.cxx          |    6 +++---
 sd/qa/unit/activex-controls-tests.cxx |   16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit ab3890b5f4ff4654eae7360d0cf34f3e26a1026f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Feb 21 19:32:17 2018 +0900

    use "Graphic" property to transport Graphic for controls
    
    Currently "ImageURL" property is used to transport the Graphic
    (as an string URL), which is being replaced by transporting
    XGraphic directly. There is already a property that all
    controls use - "Graphic", so use that instead.
    
    Change-Id: I2514b475735f3e430c2baa9b1685a231fc694b28
    Reviewed-on: https://gerrit.libreoffice.org/50139
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 9d5f4c5d27f2..ea6f461bbdcf 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -264,9 +264,9 @@ void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSe
 {
     if( rPicData.hasElements() )
     {
-        OUString aGraphicUrl = mrGraphicHelper.importGraphicObject( rPicData );
-        if( !aGraphicUrl.isEmpty() )
-            rPropMap.setProperty( PROP_ImageURL, aGraphicUrl );
+        uno::Reference<graphic::XGraphic> xGraphic = mrGraphicHelper.importGraphic(rPicData);
+        if (xGraphic.is())
+            rPropMap.setProperty(PROP_Graphic, xGraphic);
     }
 }
 
diff --git a/sd/qa/unit/activex-controls-tests.cxx b/sd/qa/unit/activex-controls-tests.cxx
index f82f29e4eb98..186d9a737624 100644
--- a/sd/qa/unit/activex-controls-tests.cxx
+++ b/sd/qa/unit/activex-controls-tests.cxx
@@ -1119,9 +1119,9 @@ void SdActiveXControlsTest::testPictureProperties()
         CPPUNIT_ASSERT(xControlShape.is());
         uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
 
-        OUString sImageURL;
-        xPropertySet->getPropertyValue("ImageURL") >>= sImageURL;
-        CPPUNIT_ASSERT(!sImageURL.isEmpty());
+        uno::Reference<graphic::XGraphic> xGraphic;
+        xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
+        CPPUNIT_ASSERT(xGraphic.is());
 
         sal_Int16 nColor;
         xPropertySet->getPropertyValue("ImagePosition") >>= nColor;
@@ -1138,12 +1138,12 @@ void SdActiveXControlsTest::testPictureProperties()
 
         OString sMessage = "The wrong control's index is: " + OString::number(i);
 
-        OUString sImageURL;
-        xPropertySet->getPropertyValue("ImageURL") >>= sImageURL;
+        uno::Reference<graphic::XGraphic> xGraphic;
+        xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
         if (i == 0) // First control has no image specified
-            CPPUNIT_ASSERT_MESSAGE(sMessage.getStr(), sImageURL.isEmpty());
+            CPPUNIT_ASSERT_MESSAGE(sMessage.getStr(), !xGraphic.is());
         else
-            CPPUNIT_ASSERT_MESSAGE(sMessage.getStr(), !sImageURL.isEmpty());
+            CPPUNIT_ASSERT_MESSAGE(sMessage.getStr(), xGraphic.is());
 
         sal_Int16 nScaleMode;
         xPropertySet->getPropertyValue("ScaleMode") >>= nScaleMode;
@@ -1225,4 +1225,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(SdActiveXControlsTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list