[Libreoffice-commits] .: 2 commits - fpicker/source sfx2/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue May 15 07:31:35 PDT 2012


 fpicker/source/office/PlacesListBox.hxx |    8 ++++----
 sfx2/source/doc/docvor.cxx              |   11 ++++++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit cdd4d969b1446ca0492adda239f5caf9987b84eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 15 15:25:05 2012 +0100

    Related: rhbz#790233 Allow styles to be deleted from the template dialog
    
    I knew this used to work at some stage, appears to be a
    regression since cdf8680ed24a56956f257c99c73ff95ff488e2c6
    GetIndices_Impl gives the region and index of the entry relative to the
    immediate parent, so doesn't make sense to use those as indexes
    into the template array if we're at the style level.
    
    backup into the template level if we're below it to get the
    relevant template index.
    
    Change-Id: I37a0bbc38cbb4dd82dd3d2c8309d8be61d83adbd

diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 5ed0027..a1eded4 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -1679,8 +1679,17 @@ sal_Bool SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry* pEntry )
         return sal_True;
     }
 
+    //If delete is pressed on e.g. a style entry go up the chain to find the
+    //owning template
+    while (nDepth > 1)
+    {
+        pEntry = pFocusBox->GetParent(pEntry);
+        --nDepth;
+    }
+    SvLBoxEntry *pTemplateEntry = pEntry;
+
     sal_uInt16 nRegion = 0, nIndex = 0;
-    GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex );
+    GetIndices_Impl( pFocusBox, pTemplateEntry, nRegion, nIndex );
     const SfxDocumentTemplates* pTemplates = aMgr.GetTemplates();
     if ( !pTemplates || !pTemplates->HasUserContents( nRegion, nIndex ) )
         return sal_True;
commit 8856ec1904882c69a38f6898b3c4d9227e7257b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 15 14:43:56 2012 +0100

    WaE: unsafe mix of bool and sal_Bool
    
    Change-Id: I0b52eead997b8d6937088aade660be78d600b8b4

diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index 30e4cc7..74ae8e7 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -44,11 +44,11 @@ class Place
         rtl::OUString msName;
         INetURLObject maUrl;
 
-        sal_Bool mbEditable;
+        bool mbEditable;
 
     public:
 
-        Place( rtl::OUString sName, rtl::OUString sUrl, sal_Bool bEditable = false) :
+        Place( rtl::OUString sName, rtl::OUString sUrl, bool bEditable = false) :
 			msName( sName ),
 			maUrl( sUrl ),
 			mbEditable( bEditable ) {};
@@ -63,8 +63,8 @@ class Place
         rtl::OUString& GetName( ) { return msName; }
         rtl::OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); }
         INetURLObject& GetUrlObject( ) { return maUrl; }
-        sal_Bool  IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; };
-        sal_Bool& IsEditable( ) { return mbEditable; }
+        bool  IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; }
+        bool  IsEditable( ) { return mbEditable; }
 };
 
 typedef boost::shared_ptr< Place > PlacePtr;


More information about the Libreoffice-commits mailing list