[Libreoffice-commits] .: 4 commits - framework/source officecfg/registry sfx2/uiconfig svtools/inc svtools/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 11 03:16:12 PDT 2012


 framework/source/loadenv/loadenv.cxx                                 |    6 
 framework/source/services/desktop.cxx                                |   18 +-
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    2 
 sfx2/uiconfig/ui/password.ui                                         |    8 -
 svtools/inc/svtools/ctrltool.hxx                                     |   64 ++++-----
 svtools/source/control/ctrlbox.cxx                                   |   10 -
 svtools/source/control/ctrltool.cxx                                  |   70 ++++------
 vcl/source/control/edit.cxx                                          |    8 +
 8 files changed, 94 insertions(+), 92 deletions(-)

New commits:
commit 1a3a787766842751b1f9013ac7f0be3633284f75
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 11 10:58:16 2012 +0100

    import password echo char setting
    
    Change-Id: I36a82a8bb915e72a191787a2e44f9bd814271ea1

diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
index 598535c..9316316 100644
--- a/sfx2/uiconfig/ui/password.ui
+++ b/sfx2/uiconfig/ui/password.ui
@@ -156,7 +156,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hexpand">True</property>
-                            <property name="editable">False</property>
+                            <property name="visibility">False</property>
                             <property name="invisible_char">●</property>
                             <property name="invisible_char_set">True</property>
                           </object>
@@ -172,7 +172,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hexpand">True</property>
-                            <property name="editable">False</property>
+                            <property name="visibility">False</property>
                             <property name="invisible_char">●</property>
                             <property name="invisible_char_set">True</property>
                           </object>
@@ -252,7 +252,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hexpand">True</property>
-                            <property name="editable">False</property>
+                            <property name="visibility">False</property>
                             <property name="invisible_char">●</property>
                             <property name="invisible_char_set">True</property>
                           </object>
@@ -268,7 +268,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hexpand">True</property>
-                            <property name="editable">False</property>
+                            <property name="visibility">False</property>
                             <property name="invisible_char">●</property>
                             <property name="invisible_char_set">True</property>
                           </object>
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d271051..962df08 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -234,6 +234,14 @@ bool Edit::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
         SetMaxWidthInChars(rValue.toInt32());
     else if (rKey == "editable")
         SetReadOnly(!toBool(rValue));
+    else if (rKey == "visibility")
+    {
+        WinBits nBits = GetStyle();
+        nBits &= ~(WB_PASSWORD);
+        if (!toBool(rValue))
+            nBits |= WB_PASSWORD;
+        SetStyle(nBits);
+    }
     else
         return Control::set_property(rKey, rValue);
     return true;
commit f2734389f517c1f99eee2346ae9d2104cc7de842
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 11 10:30:47 2012 +0100

    XubString->OUString
    
    Change-Id: I15f229010254a51ee485479e8fb751375f288da8

diff --git a/svtools/inc/svtools/ctrltool.hxx b/svtools/inc/svtools/ctrltool.hxx
index f7c4cc5..837c29d 100644
--- a/svtools/inc/svtools/ctrltool.hxx
+++ b/svtools/inc/svtools/ctrltool.hxx
@@ -32,7 +32,7 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 
 #include "svtools/svtdllapi.h"
-
+#include <rtl/ustring.hxx>
 #include <sal/types.h>
 #include <vcl/metric.hxx>
 
@@ -147,27 +147,27 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
 class SVT_DLLPUBLIC FontList
 {
 private:
-    XubString               maMapBoth;
-    XubString               maMapPrinterOnly;
-    XubString               maMapScreenOnly;
-    XubString               maMapSizeNotAvailable;
-    XubString               maMapStyleNotAvailable;
-    XubString               maMapNotAvailable;
-    XubString               maLight;
-    XubString               maLightItalic;
-    XubString               maNormal;
-    XubString               maNormalItalic;
-    XubString               maBold;
-    XubString               maBoldItalic;
-    XubString               maBlack;
-    XubString               maBlackItalic;
+    OUString                maMapBoth;
+    OUString                maMapPrinterOnly;
+    OUString                maMapScreenOnly;
+    OUString                maMapSizeNotAvailable;
+    OUString                maMapStyleNotAvailable;
+    OUString                maMapNotAvailable;
+    OUString                maLight;
+    OUString                maLightItalic;
+    OUString                maNormal;
+    OUString                maNormalItalic;
+    OUString                maBold;
+    OUString                maBoldItalic;
+    OUString                maBlack;
+    OUString                maBlackItalic;
     long*                   mpSizeAry;
     OutputDevice*           mpDev;
     OutputDevice*           mpDev2;
     boost::ptr_vector<ImplFontListNameInfo> maEntries;
 #ifdef CTRLTOOL_CXX
-    SVT_DLLPRIVATE ImplFontListNameInfo*    ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const;
-    SVT_DLLPRIVATE ImplFontListNameInfo*    ImplFindByName( const XubString& rStr ) const;
+    SVT_DLLPRIVATE ImplFontListNameInfo*    ImplFind( const OUString& rSearchName, sal_uLong* pIndex ) const;
+    SVT_DLLPRIVATE ImplFontListNameInfo*    ImplFindByName( const OUString& rStr ) const;
     SVT_DLLPRIVATE void                 ImplInsertFonts( OutputDevice* pDev, sal_Bool bAll,
                                              sal_Bool bInsertData );
 #endif
@@ -183,25 +183,27 @@ public:
     OutputDevice*           GetDevice() const { return mpDev; }
     OutputDevice*           GetDevice2() const { return mpDev2; }
 
-    const XubString&        GetNormalStr() const { return maNormal; }
-    const XubString&        GetItalicStr() const { return maNormalItalic; }
-    const XubString&        GetBoldStr() const { return maBold; }
-    const XubString&        GetBoldItalicStr() const { return maBoldItalic; }
-    const XubString&        GetStyleName( FontWeight eWeight, FontItalic eItalic ) const;
-    XubString               GetStyleName( const FontInfo& rInfo ) const;
+    const OUString&         GetNormalStr() const { return maNormal; }
+    const OUString&         GetItalicStr() const { return maNormalItalic; }
+    const OUString&         GetBoldStr() const { return maBold; }
+    const OUString&         GetBoldItalicStr() const { return maBoldItalic; }
+    const OUString&         GetStyleName( FontWeight eWeight, FontItalic eItalic ) const;
+    OUString                GetStyleName( const FontInfo& rInfo ) const;
 
-    FontInfo                Get( const XubString& rName,
-                                 const XubString& rStyleName ) const;
-    FontInfo                Get( const XubString& rName,
+    FontInfo                Get( const OUString& rName,
+                                 const OUString& rStyleName ) const;
+    FontInfo                Get( const OUString& rName,
                                  FontWeight eWeight,
                                  FontItalic eItalic ) const;
 
-    sal_Bool                    IsAvailable( const XubString& rName ) const;
-    sal_uInt16                  GetFontNameCount() const
-                                { return (sal_uInt16)maEntries.size(); }
+    sal_Bool                IsAvailable( const OUString& rName ) const;
+    sal_uInt16              GetFontNameCount() const
+    {
+        return (sal_uInt16)maEntries.size();
+    }
     const FontInfo&         GetFontName( sal_uInt16 nFont ) const;
-    sal_uInt16                  GetFontNameType( sal_uInt16 nFont ) const;
-    sal_Handle              GetFirstFontInfo( const XubString& rName ) const;
+    sal_uInt16              GetFontNameType( sal_uInt16 nFont ) const;
+    sal_Handle              GetFirstFontInfo( const OUString& rName ) const;
     sal_Handle              GetNextFontInfo( sal_Handle hFontInfo ) const;
     const FontInfo&         GetFontInfo( sal_Handle hFontInfo ) const;
 
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index fc99145..26b284d 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1598,7 +1598,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
     sal_Handle hFontInfo = pList->GetFirstFontInfo( rName );
     if ( hFontInfo )
     {
-        XubString   aStyleText;
+        OUString aStyleText;
         FontWeight  eLastWeight = WEIGHT_DONTKNOW;
         FontItalic  eLastItalic = ITALIC_NONE;
         FontWidth   eLastWidth = WIDTH_DONTKNOW;
@@ -1657,11 +1657,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
                 {
                     // If we have two names for the same attributes
                     // we prefer the translated standard names
-                    const XubString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic );
-                    if ( rAttrStyleText != aStyleText )
+                    const OUString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic );
+                    if (rAttrStyleText != aStyleText)
                     {
-                        XubString aTempStyleText = pList->GetStyleName( aInfo );
-                        if ( rAttrStyleText == aTempStyleText )
+                        OUString aTempStyleText = pList->GetStyleName( aInfo );
+                        if (rAttrStyleText == aTempStyleText)
                             aStyleText = rAttrStyleText;
                         bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND;
                     }
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 25b6878..44da6fc 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -175,14 +175,13 @@ static void ImplMakeSearchStringFromName( XubString& rStr )
 
 // -----------------------------------------------------------------------
 
-ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const
+ImplFontListNameInfo* FontList::ImplFind(const OUString& rSearchName, sal_uLong* pIndex) const
 {
     // Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als
     // der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem
     // letzten Eintrag, da die Liste von VCL auch sortiert zurueckkommt
     // und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
     // sehr gross ist.
-    StringCompare eComp;
     sal_uLong nCnt = maEntries.size();
     if ( !nCnt )
     {
@@ -193,14 +192,14 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
     else
     {
         const ImplFontListNameInfo* pCmpData = &maEntries[nCnt-1];
-        eComp = rSearchName.CompareTo( pCmpData->maSearchName );
-        if ( eComp == COMPARE_GREATER )
+        sal_Int32 nComp = rSearchName.compareTo( pCmpData->maSearchName );
+        if (nComp > 0)
         {
             if ( pIndex )
                 *pIndex = ULONG_MAX;
             return NULL;
         }
-        else if ( eComp == COMPARE_EQUAL )
+        else if (nComp == 0)
             return const_cast<ImplFontListNameInfo*>(pCmpData);
     }
 
@@ -215,8 +214,8 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
     {
         nMid = (nLow + nHigh) / 2;
         pCompareData = &maEntries[nMid];
-        eComp = rSearchName.CompareTo( pCompareData->maSearchName );
-        if ( eComp == COMPARE_LESS )
+        sal_Int32 nComp = rSearchName.compareTo(pCompareData->maSearchName);
+        if (nComp < 0)
         {
             if ( !nMid )
                 break;
@@ -224,7 +223,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
         }
         else
         {
-            if ( eComp == COMPARE_GREATER )
+            if (nComp > 0)
                 nLow = nMid + 1;
             else
             {
@@ -237,8 +236,8 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
 
     if ( pIndex )
     {
-        eComp = rSearchName.CompareTo( pCompareData->maSearchName );
-        if ( eComp == COMPARE_GREATER )
+        sal_Int32 nComp = rSearchName.compareTo(pCompareData->maSearchName);
+        if (nComp > 0)
             *pIndex = (nMid+1);
         else
             *pIndex = nMid;
@@ -249,7 +248,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
 
 // -----------------------------------------------------------------------
 
-ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const
+ImplFontListNameInfo* FontList::ImplFindByName(const OUString& rStr) const
 {
     XubString aSearchName = rStr;
     ImplMakeSearchStringFromName( aSearchName );
@@ -425,7 +424,7 @@ FontList* FontList::Clone() const
 
 // -----------------------------------------------------------------------
 
-const XubString& FontList::GetStyleName( FontWeight eWeight, FontItalic eItalic ) const
+const OUString& FontList::GetStyleName(FontWeight eWeight, FontItalic eItalic) const
 {
     if ( eWeight > WEIGHT_BOLD )
     {
@@ -466,41 +465,40 @@ const XubString& FontList::GetStyleName( FontWeight eWeight, FontItalic eItalic
 
 // -----------------------------------------------------------------------
 
-XubString FontList::GetStyleName( const FontInfo& rInfo ) const
+OUString FontList::GetStyleName(const FontInfo& rInfo) const
 {
-    XubString   aStyleName = rInfo.GetStyleName();
-    FontWeight  eWeight = rInfo.GetWeight();
-    FontItalic  eItalic = rInfo.GetItalic();
+    OUString aStyleName = rInfo.GetStyleName();
+    FontWeight eWeight = rInfo.GetWeight();
+    FontItalic eItalic = rInfo.GetItalic();
 
     // Nur wenn kein StyleName gesetzt ist, geben wir einen syntetischen
     // Namen zurueck
-    if ( !aStyleName.Len() )
-        aStyleName = GetStyleName( eWeight, eItalic );
+    if (aStyleName.isEmpty())
+        aStyleName = GetStyleName(eWeight, eItalic);
     else
     {
         // Translate StyleName to localized name
-        XubString aCompareStyleName = aStyleName;
-        aCompareStyleName.ToLowerAscii();
+        OUString aCompareStyleName = aStyleName.toAsciiLowerCase();
         aCompareStyleName = comphelper::string::remove(aCompareStyleName, ' ');
-        if ( aCompareStyleName.EqualsAscii( "bold" ) )
+        if (aCompareStyleName == "bold")
             aStyleName = maBold;
-        else if ( aCompareStyleName.EqualsAscii( "bolditalic" ) )
+        else if (aCompareStyleName == "bolditalic")
             aStyleName = maBoldItalic;
-        else if ( aCompareStyleName.EqualsAscii( "italic" ) )
+        else if (aCompareStyleName == "italic")
             aStyleName = maNormalItalic;
-        else if ( aCompareStyleName.EqualsAscii( "standard" ) )
+        else if (aCompareStyleName == "standard")
             aStyleName = maNormal;
-        else if ( aCompareStyleName.EqualsAscii( "regular" ) )
+        else if (aCompareStyleName == "regular")
             aStyleName = maNormal;
-        else if ( aCompareStyleName.EqualsAscii( "medium" ) )
+        else if (aCompareStyleName == "medium")
             aStyleName = maNormal;
-        else if ( aCompareStyleName.EqualsAscii( "light" ) )
+        else if (aCompareStyleName == "light")
             aStyleName = maLight;
-        else if ( aCompareStyleName.EqualsAscii( "lightitalic" ) )
+        else if (aCompareStyleName == "lightitalic")
             aStyleName = maLightItalic;
-        else if ( aCompareStyleName.EqualsAscii( "black" ) )
+        else if (aCompareStyleName == "black")
             aStyleName = maBlack;
-        else if ( aCompareStyleName.EqualsAscii( "blackitalic" ) )
+        else if (aCompareStyleName == "blackitalic")
             aStyleName = maBlackItalic;
 
         // fix up StyleName, because the PS Printer driver from
@@ -544,7 +542,7 @@ namespace
     }
 }
 
-FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) const
+FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const
 {
     ImplFontListNameInfo* pData = ImplFindByName( rName );
     ImplFontListFontInfo* pFontInfo = NULL;
@@ -556,7 +554,7 @@ FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) co
         pSearchInfo = pData->mpFirst;
         while ( pSearchInfo )
         {
-            if ( rStyleName.EqualsIgnoreCaseAscii( GetStyleName( *pSearchInfo ) ) )
+            if (rStyleName.equalsIgnoreAsciiCase(GetStyleName(*pSearchInfo)))
             {
                 pFontInfo = pSearchInfo;
                 break;
@@ -628,8 +626,8 @@ FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) co
 
 // -----------------------------------------------------------------------
 
-FontInfo FontList::Get( const XubString& rName,
-                        FontWeight eWeight, FontItalic eItalic ) const
+FontInfo FontList::Get(const OUString& rName,
+                        FontWeight eWeight, FontItalic eItalic) const
 {
     ImplFontListNameInfo* pData = ImplFindByName( rName );
     ImplFontListFontInfo* pFontInfo = NULL;
@@ -667,7 +665,7 @@ FontInfo FontList::Get( const XubString& rName,
 
 // -----------------------------------------------------------------------
 
-sal_Bool FontList::IsAvailable( const XubString& rName ) const
+sal_Bool FontList::IsAvailable(const OUString& rName) const
 {
     return (ImplFindByName( rName ) != 0);
 }
@@ -692,7 +690,7 @@ sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
 
 // -----------------------------------------------------------------------
 
-sal_Handle FontList::GetFirstFontInfo( const XubString& rName ) const
+sal_Handle FontList::GetFirstFontInfo(const OUString& rName) const
 {
     ImplFontListNameInfo* pData = ImplFindByName( rName );
     if ( !pData )
commit 7d044841e88d2413c19715a290b3d7a2ba6d099d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 11 10:11:26 2012 +0100

    loplugin: misleading indent
    
    Change-Id: Ia3c27c2b2e869af09557ad50e51a65894943947a

diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 243f8bc..b5dac0f 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1383,8 +1383,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
     css::uno::Reference< css::frame::XFrame > xResult;
     if (xTask.is())
         xResult = xTask;
-    else
-    if (xHiddenTask.is())
+    else if (xHiddenTask.is())
         xResult = xHiddenTask;
 
     if (xResult.is())
@@ -1578,8 +1577,7 @@ void LoadEnv::impl_reactForLoadingState()
             if (pWindow && pWindow->IsSystemWindow())
                 ((WorkWindow*)pWindow)->Minimize();
         }
-        else
-        if (!bHidden)
+        else if (!bHidden)
         {
             // show frame ... if it's not still visible ...
             // But do nothing if it's already visible!
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 8a03aa3..713ad4a 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1068,8 +1068,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const ::r
     // I.II) "_top"
     //  We are top by definition
     //-----------------------------------------------------------------------------------------------------
-    else
-    if ( sTargetFrameName==SPECIALTARGET_TOP )
+    else if ( sTargetFrameName==SPECIALTARGET_TOP )
     {
         xTarget = this;
     }
@@ -1078,11 +1077,10 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const ::r
     // I.III) "_self", ""
     //  This mean this "frame" in every case.
     //-----------------------------------------------------------------------------------------------------
-    else
-    if (
-        ( sTargetFrameName==SPECIALTARGET_SELF ) ||
-        ( sTargetFrameName.isEmpty()           )
-       )
+    else if (
+             ( sTargetFrameName==SPECIALTARGET_SELF ) ||
+             ( sTargetFrameName.isEmpty()           )
+            )
     {
         xTarget = this;
     }
@@ -1414,8 +1412,7 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio
             xFilterSelect->select();
         }
     }
-    else
-    if( aRequest >>= aErrorCodeRequest )
+    else if( aRequest >>= aErrorCodeRequest )
     {
         sal_Bool bWarning = ((aErrorCodeRequest.ErrCode & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
         if (xApprove.is() && bWarning)
@@ -1427,8 +1424,7 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio
             bAbort = sal_True;
         }
     }
-    else
-    if( xAbort.is() )
+    else if( xAbort.is() )
     {
         xAbort->select();
         bAbort = sal_True;
commit eafa9394cb6078dee57aff3f7ecbd19ef1af5bce
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 11 09:47:27 2012 +0100

    add ellipsis to Floating Frame because it pops up a dialog
    
    Change-Id: I2fe888e79cf1a2ac56ed6115f3548c012b670d5f

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 07f55f3..f8a45f1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2603,7 +2603,7 @@
             </node>
             <node oor:name=".uno:InsertObjectFloatingFrame" oor:op="replace">
                 <prop oor:name="Label" oor:type="xs:string">
-                    <value xml:lang="en-US">Float~ing Frame</value>
+                    <value xml:lang="en-US">Float~ing Frame...</value>
                 </prop>
                 <prop oor:name="Properties" oor:type="xs:int">
                     <value>1</value>


More information about the Libreoffice-commits mailing list