[Libreoffice-commits] core.git: 3 commits - framework/source include/vcl sw/inc vcl/source

Caolán McNamara caolanm at redhat.com
Fri Jan 20 16:50:51 UTC 2017


 framework/source/uiconfiguration/imagemanagerimpl.cxx |    8 ++---
 include/vcl/commandinfoprovider.hxx                   |    5 +++
 sw/inc/ToxLinkProcessor.hxx                           |    2 -
 vcl/source/helper/commandinfoprovider.cxx             |   28 ++++++++++++------
 4 files changed, 29 insertions(+), 14 deletions(-)

New commits:
commit c41b7a397411814c98dceeea07b0a26f0d01c530
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 20 16:46:14 2017 +0000

    split GetImageForCommand into GetBitmapForCommand and co
    
    Change-Id: I89431532ef26fc33146252e218096e690825b896

diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx
index 93f4f3f..0a8e53e 100644
--- a/include/vcl/commandinfoprovider.hxx
+++ b/include/vcl/commandinfoprovider.hxx
@@ -89,6 +89,11 @@ public:
 
     OUString GetCommandPropertyFromModule( const OUString& rCommandName, const OUString& rModuleName );
 
+    BitmapEx GetBitmapForCommand(
+        const OUString& rsCommandName,
+        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        vcl::ImageType eImageType = vcl::ImageType::Small);
+
     Image GetImageForCommand(
         const OUString& rsCommandName,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index e48367c..7a844c6 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -209,14 +209,14 @@ OUString CommandInfoProvider::GetRealCommandForCommand(const OUString& rCommandN
     return GetCommandProperty("TargetURL", rCommandName);
 }
 
-Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
-                                              const Reference<frame::XFrame>& rxFrame,
-                                              vcl::ImageType eImageType)
+BitmapEx CommandInfoProvider::GetBitmapForCommand(const OUString& rsCommandName,
+                                                 const Reference<frame::XFrame>& rxFrame,
+                                                 vcl::ImageType eImageType)
 {
     SetFrame(rxFrame);
 
     if (rsCommandName.isEmpty())
-        return Image();
+        return BitmapEx();
 
     sal_Int16 nImageType(ui::ImageType::COLOR_NORMAL | ui::ImageType::SIZE_DEFAULT);
 
@@ -241,10 +241,11 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
 
             aGraphicSeq = xDocImgMgr->getImages( nImageType, aImageCmdSeq );
             Reference<graphic::XGraphic> xGraphic = aGraphicSeq[0];
-            Image aImage(xGraphic);
+            const Graphic aGraphic(xGraphic);
+            BitmapEx aBitmap(aGraphic.GetBitmapEx());
 
-            if (!!aImage)
-                return aImage;
+            if (!!aBitmap)
+                return aBitmap;
         }
     }
     catch (Exception&)
@@ -264,13 +265,22 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
 
         Reference<graphic::XGraphic> xGraphic(aGraphicSeq[0]);
 
-        return Image(xGraphic);
+        const Graphic aGraphic(xGraphic);
+
+        return aGraphic.GetBitmapEx();
     }
     catch (Exception&)
     {
     }
 
-    return Image();
+    return BitmapEx();
+}
+
+Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
+                                              const Reference<frame::XFrame>& rxFrame,
+                                              vcl::ImageType eImageType)
+{
+    return Image(GetBitmapForCommand(rsCommandName, rxFrame, eImageType));
 }
 
 sal_Int32 CommandInfoProvider::GetPropertiesForCommand (
commit aa0951b22d958813a41f71f536bb4a07aa0e7f07
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 20 16:03:08 2017 +0000

    empty Image is an empty XGraphic
    
    Change-Id: I43fa17c2ef9324c841344554b093500d0fb26165

diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index 6d6e6ba..d1e73bc 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -224,7 +224,7 @@ static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic
 
     if ( !rInGraphic.is() )
     {
-        rOutGraphic = Image().GetXGraphic();
+        rOutGraphic = uno::Reference<graphic::XGraphic>();
         return false;
     }
 
@@ -882,7 +882,7 @@ throw ( css::lang::IllegalArgumentException,
             pDefaultImageList = implts_getDefaultImageList();
         }
         ImageList*                        pImageList        = implts_getUserImageList(nIndex);
-        uno::Reference< XGraphic >        xEmptyGraphic( Image().GetXGraphic() );
+        uno::Reference<XGraphic> xEmptyGraphic;
 
         for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
         {
@@ -1034,8 +1034,8 @@ void ImageManagerImpl::reload()
                     rGlobalImageList  = implts_getGlobalImageList();
                     pDefaultImageList = implts_getDefaultImageList();
                 }
-                uno::Reference< XGraphic >        xEmptyGraphic( Image().GetXGraphic() );
-                CommandMap::const_iterator        pIter = aOldUserCmdImageSet.begin();
+                uno::Reference<XGraphic> xEmptyGraphic;
+                CommandMap::const_iterator pIter = aOldUserCmdImageSet.begin();
                 while ( pIter != aOldUserCmdImageSet.end() )
                 {
                     if ( !pIter->second )
commit 92bfe7e3052a7540c81d9fa152f55920ad00b8ee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 20 15:42:45 2017 +0000

    doesn't seem to be a reason start and end are swapped
    
    Change-Id: If1ccdd303bc7c6e69360295c599270c41d03f3f7

diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx
index 699c0ec..30fa07e 100644
--- a/sw/inc/ToxLinkProcessor.hxx
+++ b/sw/inc/ToxLinkProcessor.hxx
@@ -70,7 +70,7 @@ private:
      */
     struct ClosedLink {
         ClosedLink(const OUString& url, sal_Int32 startPosition, sal_Int32 endPosition) :
-                mINetFormat(url, OUString()), mStartTextPos(endPosition), mEndTextPos(startPosition) {
+                mINetFormat(url, OUString()), mStartTextPos(startPosition), mEndTextPos(endPosition) {
         }
         SwFormatINetFormat mINetFormat;
         sal_Int32 mStartTextPos;


More information about the Libreoffice-commits mailing list