[Libreoffice-commits] .: 3 commits - basic/source cui/source filter/source sc/source sd/source svx/inc svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 30 02:49:59 PST 2013


 basic/source/sbx/sbxvalue.cxx           |    4 ++--
 cui/source/tabpages/tpshadow.cxx        |    3 +--
 filter/source/msfilter/msdffimp.cxx     |    2 +-
 sc/source/filter/excel/xiescher.cxx     |    2 +-
 sd/source/core/drawdoc4.cxx             |   12 ++++--------
 sd/source/core/stlpool.cxx              |    2 +-
 svx/inc/svx/sdshcitm.hxx                |   15 ++++++---------
 svx/inc/svx/xcolit.hxx                  |    1 +
 svx/source/accessibility/charmapacc.cxx |    8 ++++----
 svx/source/inc/charmapacc.hxx           |    4 ++--
 svx/source/svdraw/svdattr.cxx           |    3 +--
 svx/source/table/svdotable.cxx          |    5 ++---
 svx/source/xoutdev/xattr.cxx            |    6 ++++++
 13 files changed, 32 insertions(+), 35 deletions(-)

New commits:
commit d7ecbd0e655efb193da1561649ebd13fdd2f5af1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 30 10:40:45 2013 +0000

    the name field for SdrShadowColorItem seems to be redundant now
    
    Change-Id: I6e90cdfc9577bfa0ee1dd1018a41aa7979dfaf04

diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index c0fa6c2..fa87c6c 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -334,8 +334,7 @@ sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
         if( nPos != LISTBOX_ENTRY_NOTFOUND &&
             nPos != aLbShadowColor.GetSavedValue() )
         {
-            SdrShadowColorItem aItem( aLbShadowColor.GetSelectEntry(),
-                                    aLbShadowColor.GetSelectEntryColor() );
+            SdrShadowColorItem aItem(aLbShadowColor.GetSelectEntryColor());
             pOld = GetOldItem( rAttrs, SDRATTR_SHADOWCOLOR );
             if ( !pOld || !( *(const SdrShadowColorItem*)pOld == aItem ) )
             {
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 23ab741..dda08b4 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2598,7 +2598,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
         }
     }
     if ( IsProperty( DFF_Prop_shadowColor ) )
-        rSet.Put( SdrShadowColorItem( OUString(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
+        rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
     if ( IsProperty( DFF_Prop_shadowOpacity ) )
         rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
     if ( IsProperty( DFF_Prop_shadowOffsetX ) )
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 24a5cc6..3af643f 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -691,7 +691,7 @@ void XclImpDrawObjBase::ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrame
         rSdrObj.SetMergedItem( SdrShadowItem( sal_True ) );
         rSdrObj.SetMergedItem( SdrShadowXDistItem( 35 ) );
         rSdrObj.SetMergedItem( SdrShadowYDistItem( 35 ) );
-        rSdrObj.SetMergedItem( SdrShadowColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
+        rSdrObj.SetMergedItem( SdrShadowColorItem( GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
     }
 }
 
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 3758a19..4e5cf19 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -147,8 +147,6 @@ void SdDrawDocument::CreateLayoutTemplates()
     SfxItemSet& rISet = pSheet->GetItemSet();
     SfxItemPool* pPool = rISet.GetPool();
 
-    String   aNullStr;
-
     ::basegfx::B2DPolyPolygon aNullPolyPolygon;
     Color    aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
 
@@ -185,7 +183,7 @@ void SdDrawDocument::CreateLayoutTemplates()
 
                     // Schattenattribute (Drawing Engine)
     rISet.Put(SdrShadowItem(sal_False));
-    rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
+    rISet.Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
     rISet.Put(SdrShadowXDistItem(200));         // 3 mm Schattendistanz
     rISet.Put(SdrShadowYDistItem(200));
 
@@ -294,7 +292,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet = &pSheet->GetItemSet();
 
     pISet->Put(SdrShadowItem(sal_True));
-    pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
+    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(SdrShadowXDistItem(200));        // 3 mm Schattendistanz
     pISet->Put(SdrShadowYDistItem(200));
 
@@ -387,7 +385,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet->Put(XFillColorItem(String(), RGB_Color(COL_CYAN)));
 
     pISet->Put(SdrShadowItem(sal_True));
-    pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
+    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(SdrShadowXDistItem(200));        // 2 mm Schattendistanz
     pISet->Put(SdrShadowYDistItem(200));
 
@@ -411,7 +409,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet->Put(XFillColorItem(String(), aOrange4));
 
     pISet->Put(SdrShadowItem(sal_True));
-    pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
+    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(SdrShadowXDistItem(200));        // 2 mm Schattendistanz
     pISet->Put(SdrShadowYDistItem(200));
 
@@ -556,8 +554,6 @@ void SdDrawDocument::CreateDefaultCellStyles()
     pSheet->SetHelpId( aHelpFile, HID_SD_CELL_STYLE_DEFAULT );
     SfxItemSet& rISet = pSheet->GetItemSet();
 
-    String   aNullStr;
-
     Color    aNullCol(RGB_Color(COL_BLACK));
 
     XDash     aNullDash;
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index cfe6c82..4b48d1f 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -475,7 +475,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
         pSheet->SetParent(String());
         SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
         rBackgroundObjectsSet.Put(SdrShadowItem(sal_False));
-        rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY)));
+        rBackgroundObjectsSet.Put(SdrShadowColorItem(Color(COL_GRAY)));
         rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
         rBackgroundObjectsSet.Put(SdrShadowYDistItem(200));
         // #i16874# enable kerning by default but only for new documents
diff --git a/svx/inc/svx/sdshcitm.hxx b/svx/inc/svx/sdshcitm.hxx
index 3151348..f399a06 100644
--- a/svx/inc/svx/sdshcitm.hxx
+++ b/svx/inc/svx/sdshcitm.hxx
@@ -25,11 +25,8 @@
 class SdrShadowColorItem: public XColorItem
 {
 public:
-    SdrShadowColorItem()
-    {
-    }
-    SdrShadowColorItem(const String& rName, const Color& rTheColor)
-        : XColorItem(SDRATTR_SHADOWCOLOR, rName, rTheColor)
+    SdrShadowColorItem(const Color& rTheColor)
+        : XColorItem(SDRATTR_SHADOWCOLOR, rTheColor)
     {
     }
 };
diff --git a/svx/inc/svx/xcolit.hxx b/svx/inc/svx/xcolit.hxx
index fa56a28..461c2b3 100644
--- a/svx/inc/svx/xcolit.hxx
+++ b/svx/inc/svx/xcolit.hxx
@@ -42,6 +42,7 @@ public:
     virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
     virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
 
+            XColorItem(sal_uInt16 nWhich, const Color& rTheColor);
             XColorItem(sal_uInt16 nWhich, const String& rName, const Color& rTheColor);
             XColorItem(sal_uInt16 nWhich, SvStream& rIn);
             XColorItem(const XColorItem& rItem);
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 534ffc6..fe53385 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -95,7 +95,7 @@ SdrItemPool::SdrItemPool(
 
     // init own PoolDefaults
     mppLocalPoolDefaults[SDRATTR_SHADOW            -SDRATTR_START]=new SdrShadowItem;
-    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(OUString(),aNullCol);
+    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(aNullCol);
     mppLocalPoolDefaults[SDRATTR_SHADOWXDIST       -SDRATTR_START]=new SdrShadowXDistItem;
     mppLocalPoolDefaults[SDRATTR_SHADOWYDIST       -SDRATTR_START]=new SdrShadowYDistItem;
     mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 561f295..0651587 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -336,6 +336,12 @@ XColorItem::XColorItem(sal_uInt16 _nWhich, const XubString& rName, const Color&
 {
 }
 
+XColorItem::XColorItem(sal_uInt16 _nWhich, const Color& rTheColor)
+    : NameOrIndex(_nWhich, OUString())
+    , aColor(rTheColor)
+{
+}
+
 /*************************************************************************
 |*
 |*    XColorItem::XColorItem(const XColorItem& rItem)
commit a50ee91a17374d3ccfe277d9a0d27599a6ada789
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 30 01:42:16 2013 +0000

    SdrShadowColorItem(long nIndex, ...) variant never used
    
    Change-Id: Ibae83ceac3c2e1f678c35a12d68ef3779879314d

diff --git a/svx/inc/svx/sdshcitm.hxx b/svx/inc/svx/sdshcitm.hxx
index cc55999..3151348 100644
--- a/svx/inc/svx/sdshcitm.hxx
+++ b/svx/inc/svx/sdshcitm.hxx
@@ -22,16 +22,16 @@
 #include <svx/xcolit.hxx>
 #include <svx/svddef.hxx>
 
-//---------------------
-// class SdrShadowColorItem
-//---------------------
-class SdrShadowColorItem: public XColorItem {
+class SdrShadowColorItem: public XColorItem
+{
 public:
-    SdrShadowColorItem() {}
-    SdrShadowColorItem(long nIndex, const Color& rTheColor):          XColorItem(SDRATTR_SHADOWCOLOR,nIndex,rTheColor) {}
-
-    SdrShadowColorItem(const String& rName, const Color& rTheColor):  XColorItem(SDRATTR_SHADOWCOLOR,rName,rTheColor) {}
-
+    SdrShadowColorItem()
+    {
+    }
+    SdrShadowColorItem(const String& rName, const Color& rTheColor)
+        : XColorItem(SDRATTR_SHADOWCOLOR, rName, rTheColor)
+    {
+    }
 };
 
 #endif
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index d0e34eb..fd1c8da 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1842,8 +1842,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
             {
                 // if its only one paragraph, check if it is empty
                 OUString aStr(rOutl.GetText(p1stPara));
-
-                if(aStr.isEmpty())
+                if (aStr.isEmpty())
                 {
                     // gotcha!
                     nParaAnz = 0;
commit 015a93d6b6ba88382ca5cb13a59dda3e47e08eb6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 30 01:32:22 2013 +0000

    make basic XubString free
    
    Change-Id: Iea5c01fe902b052a55c86ca3b879bcca12c80690

diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 6b48666..e4d9000 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1420,7 +1420,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
         case SbxSINGLE:
         {
             // Floats as ASCII
-            XubString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r,
+            OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r,
                 RTL_TEXTENCODING_ASCII_US);
             double d;
             SbxDataType t;
@@ -1436,7 +1436,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
         case SbxDOUBLE:
         {
             // Floats as ASCII
-            XubString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r,
+            OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r,
                 RTL_TEXTENCODING_ASCII_US);
             SbxDataType t;
             if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK )
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index 46fabeb..2644aca 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -700,7 +700,7 @@ sal_Int16 SAL_CALL SvxShowCharSetItemAcc::getAccessibleRole()
     ensureAlive();
     String sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE );
 
-    sal_Unicode c = mpParent->maText.GetChar(0);
+    sal_Unicode c = mpParent->maText[0];
     char buf[16] = "0x0000";
     sal_Unicode c_Shifted = c;
     for( int i = 0; i < 4; ++i )
@@ -718,18 +718,18 @@ sal_Int16 SAL_CALL SvxShowCharSetItemAcc::getAccessibleRole()
 
 // -----------------------------------------------------------------------------
 
-::rtl::OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleName()
+OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleName()
     throw (uno::RuntimeException)
 {
     OExternalLockGuard aGuard( this );
     ensureAlive();
-    String aRet;
+    OUString aRet;
 
     if( mpParent )
     {
         aRet = mpParent->maText;
 
-        if( !aRet.Len() )
+        if (aRet.isEmpty())
             aRet = getAccessibleDescription();
     }
 
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index 881384a..d9abdb9 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -96,8 +96,8 @@ namespace svx
     struct SvxShowCharSetItem
     {
         SvxShowCharSet&             mrParent;
-        sal_uInt16                      mnId;
-        XubString                   maText;
+        sal_uInt16                  mnId;
+        OUString                    maText;
         Rectangle                   maRect;
         SvxShowCharSetItemAcc*      m_pItem;
         SvxShowCharSetAcc*          m_pParent;
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 4ce0137..534ffc6 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -85,7 +85,6 @@ SdrItemPool::SdrItemPool(
 {
     // prepare some constants
     const Color aNullCol(RGB_Color(COL_BLACK));
-    const XubString aEmptyStr;
     const sal_Int32 nDefEdgeDist(500L); // Defaulting hard for Draw (100TH_MM) currently. MapMode will have to be taken into account in the future.
 
     // init the non-persistent items
@@ -96,7 +95,7 @@ SdrItemPool::SdrItemPool(
 
     // init own PoolDefaults
     mppLocalPoolDefaults[SDRATTR_SHADOW            -SDRATTR_START]=new SdrShadowItem;
-    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(aEmptyStr,aNullCol);
+    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(OUString(),aNullCol);
     mppLocalPoolDefaults[SDRATTR_SHADOWXDIST       -SDRATTR_START]=new SdrShadowXDistItem;
     mppLocalPoolDefaults[SDRATTR_SHADOWYDIST       -SDRATTR_START]=new SdrShadowYDistItem;
     mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 9bf2268..d0e34eb 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1841,9 +1841,9 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
             if(nParaAnz == 1)
             {
                 // if its only one paragraph, check if it is empty
-                XubString aStr(rOutl.GetText(p1stPara));
+                OUString aStr(rOutl.GetText(p1stPara));
 
-                if(!aStr.Len())
+                if(aStr.isEmpty())
                 {
                     // gotcha!
                     nParaAnz = 0;


More information about the Libreoffice-commits mailing list