[Libreoffice-commits] .: 2 commits - cui/source icon-themes/galaxy icon-themes/human icon-themes/industrial icon-themes/oxygen svx/inc svx/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jul 16 06:18:20 PDT 2012


 cui/source/dialogs/cuigaldlg.cxx    |    6 -
 cui/source/dialogs/gallery.src      |    5 -
 cui/source/inc/gallery.hrc          |    1 
 dev/null                            |binary
 svx/inc/gallery.hrc                 |    1 
 svx/inc/svx/gallery1.hxx            |    9 --
 svx/inc/svx/galtheme.hxx            |    4 
 svx/source/gallery2/galbrws1.cxx    |   16 ---
 svx/source/gallery2/galbrws2.cxx    |   13 --
 svx/source/gallery2/galctrl.cxx     |    2 
 svx/source/gallery2/gallery.src     |    5 -
 svx/source/gallery2/gallery1.cxx    |  160 ++++--------------------------------
 svx/source/gallery2/galtheme.cxx    |   38 +-------
 vcl/unx/gtk/inc/gtkprintwrapper.hxx |    2 
 14 files changed, 41 insertions(+), 221 deletions(-)

New commits:
commit 6d6198393e0677710191248d6f7c9ec15d0f0e0f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 16 13:57:43 2012 +0100

    Resolves: fdo#42454 'imported' gallery format doesn't appear to exist
    
    AFAICS an "imported" gallery can only be written if you already have an
    imported gallery in the first place, i.e. its something coming from an earlier
    version. All the way back to 2000, so I suspect its an earlier pre-OOo feature,
    which can't arise in practice with no migration from staroffice configs to
    OpenOffice.org or LibreOffice.
    
    Change-Id: I9f248baadb20633da129d3bcacce3d7f92ef7510

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index db1369d..51f8319 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -681,7 +681,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
     String              aObjStr( CUI_RES( RID_SVXSTR_GALLERYPROPS_OBJECT ) );
     String              aAccess;
     String              aType( SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) );
-    sal_Bool            bReadOnly = pThm->IsReadOnly() && !pThm->IsImported();
+    sal_Bool            bReadOnly = pThm->IsReadOnly();
 
     aEdtMSName.SetHelpId( HID_GALLERY_EDIT_MSNAME );
     aEdtMSName.SetText( pThm->GetName() );
@@ -722,9 +722,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
     // set image
     sal_uInt16 nId;
 
-    if( pThm->IsImported() )
-        nId = RID_SVXBMP_THEME_IMPORTED_BIG;
-    else if( pThm->IsReadOnly() )
+    if( pThm->IsReadOnly() )
         nId = RID_SVXBMP_THEME_READONLY_BIG;
     else if( pThm->IsDefault() )
         nId = RID_SVXBMP_THEME_DEFAULT_BIG;
diff --git a/cui/source/dialogs/gallery.src b/cui/source/dialogs/gallery.src
index 7f7e8ee..998e6f0 100644
--- a/cui/source/dialogs/gallery.src
+++ b/cui/source/dialogs/gallery.src
@@ -468,11 +468,6 @@ Bitmap RID_SVXBMP_THEME_NORMAL_BIG
     File = "galnorl.bmp" ;
 };
 
-Bitmap RID_SVXBMP_THEME_IMPORTED_BIG
-{
-    File = "galimpl.bmp" ;
-};
-
 Bitmap RID_SVXBMP_THEME_READONLY_BIG
 {
     File = "galrdol.bmp" ;
diff --git a/cui/source/inc/gallery.hrc b/cui/source/inc/gallery.hrc
index 218dc7c..9636384 100644
--- a/cui/source/inc/gallery.hrc
+++ b/cui/source/inc/gallery.hrc
@@ -41,7 +41,6 @@
 
 // Images
 #define RID_SVXBMP_THEME_NORMAL_BIG             (RID_CUI_GALLERY_START + 49)
-#define RID_SVXBMP_THEME_IMPORTED_BIG           (RID_CUI_GALLERY_START + 51)
 #define RID_SVXBMP_THEME_READONLY_BIG           (RID_CUI_GALLERY_START + 53)
 #define RID_SVXBMP_THEME_DEFAULT_BIG            (RID_CUI_GALLERY_START + 55)
 
diff --git a/icon-themes/galaxy/svx/res/galimpl.png b/icon-themes/galaxy/svx/res/galimpl.png
deleted file mode 100644
index 3c301f8..0000000
Binary files a/icon-themes/galaxy/svx/res/galimpl.png and /dev/null differ
diff --git a/icon-themes/galaxy/svx/res/galimps.png b/icon-themes/galaxy/svx/res/galimps.png
deleted file mode 100644
index 222f8c1..0000000
Binary files a/icon-themes/galaxy/svx/res/galimps.png and /dev/null differ
diff --git a/icon-themes/human/svx/res/galimps.png b/icon-themes/human/svx/res/galimps.png
deleted file mode 100644
index 52ecdb4..0000000
Binary files a/icon-themes/human/svx/res/galimps.png and /dev/null differ
diff --git a/icon-themes/industrial/svx/res/galimps.png b/icon-themes/industrial/svx/res/galimps.png
deleted file mode 100644
index 52ecdb4..0000000
Binary files a/icon-themes/industrial/svx/res/galimps.png and /dev/null differ
diff --git a/icon-themes/oxygen/svx/res/galimps.png b/icon-themes/oxygen/svx/res/galimps.png
deleted file mode 100644
index 52ecdb4..0000000
Binary files a/icon-themes/oxygen/svx/res/galimps.png and /dev/null differ
diff --git a/svx/inc/gallery.hrc b/svx/inc/gallery.hrc
index d4d85dd..3a477e2 100644
--- a/svx/inc/gallery.hrc
+++ b/svx/inc/gallery.hrc
@@ -64,7 +64,6 @@
 // Images
 #define RID_SVXBMP_GALLERY                      (RID_SVX_GALLERY_START + 46)
 #define RID_SVXBMP_THEME_NORMAL                 (RID_SVX_GALLERY_START + 48)
-#define RID_SVXBMP_THEME_IMPORTED               (RID_SVX_GALLERY_START + 50)
 #define RID_SVXBMP_THEME_READONLY               (RID_SVX_GALLERY_START + 52)
 #define RID_SVXBMP_THEME_DEFAULT                (RID_SVX_GALLERY_START + 54)
 #define RID_SVXIMG_GALLERY_VIEW_ICON            (RID_SVX_GALLERY_START + 56)
diff --git a/svx/inc/svx/gallery1.hxx b/svx/inc/svx/gallery1.hxx
index aad41fa..081fffd 100644
--- a/svx/inc/svx/gallery1.hxx
+++ b/svx/inc/svx/gallery1.hxx
@@ -54,7 +54,6 @@ private:
     sal_uInt32              nFileNumber;
     sal_uInt32              nId;
     sal_Bool                bReadOnly;
-    sal_Bool                bImported;
     sal_Bool                bModified;
     sal_Bool                bThemeNameFromResource;
 
@@ -64,7 +63,7 @@ private:
 public:
 
                             GalleryThemeEntry( const INetURLObject& rBaseURL, const String& rName,
-                                               sal_uInt32 nFileNumber, sal_Bool bReadOnly, sal_Bool bImported,
+                                               sal_uInt32 nFileNumber, sal_Bool bReadOnly,
                                                sal_Bool bNewFile, sal_uInt32 nId, sal_Bool bThemeNameFromResource );
                             ~GalleryThemeEntry() {};
 
@@ -75,14 +74,13 @@ public:
     const INetURLObject&    GetSdgURL() const { return aSdgURL; }
     const INetURLObject&    GetSdvURL() const { return aSdvURL; }
 
-    sal_Bool                IsImported() const { return bImported; }
     sal_Bool                IsReadOnly() const { return bReadOnly; }
     sal_Bool                IsDefault() const;
 
     sal_Bool                IsHidden() const { return aName.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/")); }
 
     sal_Bool                IsModified() const { return bModified; }
-    void                    SetModified( sal_Bool bSet ) { bModified = ( bSet && !IsImported() && !IsReadOnly() ); }
+    void                    SetModified( sal_Bool bSet ) { bModified = ( bSet && !IsReadOnly() ); }
 
     void                    SetName( const rtl::OUString& rNewName );
     sal_Bool                IsNameFromResource() const { return bThemeNameFromResource; }
@@ -102,7 +100,6 @@ struct GalleryImportThemeEntry
     rtl::OUString aThemeName;
     rtl::OUString aUIName;
     INetURLObject aURL;
-    rtl::OUString aImportName;
 };
 
 typedef ::std::vector< GalleryImportThemeEntry* > GalleryImportThemeList;
@@ -141,8 +138,6 @@ private:
 
     void                        ImplLoad( const rtl::OUString& rMultiPath );
     void                        ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbIsReadOnly );
-    void                        ImplLoadImports();
-    void                        ImplWriteImportList();
 
     SVX_DLLPUBLIC GalleryThemeEntry*            ImplGetThemeEntry( const rtl::OUString& rThemeName );
     GalleryThemeEntry*          ImplGetThemeEntry( sal_uIntPtr nThemeId );
diff --git a/svx/inc/svx/galtheme.hxx b/svx/inc/svx/galtheme.hxx
index 766bb44..972b968 100644
--- a/svx/inc/svx/galtheme.hxx
+++ b/svx/inc/svx/galtheme.hxx
@@ -99,7 +99,6 @@ class GalleryTheme : public SfxBroadcaster
 private:
 
     GalleryObjectList           aObjectList;
-    rtl::OUString               aImportName;
     String                      m_aDestDir;
     SotStorageRef               aSvDrawStorageRef;
     Gallery*                    pParent;
@@ -149,8 +148,6 @@ public:
 
     SVX_DLLPUBLIC const rtl::OUString& GetName() const;
     const rtl::OUString&        GetRealName() const;
-    const rtl::OUString&        GetImportName() const { return aImportName; }
-    void                        SetImportName(const rtl::OUString& rImportName) { aImportName = rImportName; }
 
     const String&               GetDestDir() const { return m_aDestDir; }
     void                        SetDestDir(const String& rDestDir) { m_aDestDir = rDestDir; }
@@ -177,7 +174,6 @@ public:
 
     sal_Bool                        IsThemeNameFromResource() const;
 
-    SVX_DLLPUBLIC sal_Bool          IsImported() const;
     SVX_DLLPUBLIC sal_Bool          IsReadOnly() const;
     SVX_DLLPUBLIC sal_Bool          IsDefault() const;
     sal_Bool                        IsModified() const;
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 143dde6..df80ccf 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -147,8 +147,7 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId,
     mpThemePropsDlgItemSet( NULL ),
     aImgNormal            ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_NORMAL ) ),
     aImgDefault           ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_DEFAULT ) ),
-    aImgReadOnly          ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY ) ),
-    aImgImported          ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_IMPORTED ) )
+    aImgReadOnly          ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY ) )
 {
     StartListening( *mpGallery );
 
@@ -195,9 +194,7 @@ sal_uIntPtr GalleryBrowser1::ImplInsertThemeEntry( const GalleryThemeEntry* pEnt
     {
         const Image* pImage;
 
-        if( pEntry->IsImported() )
-            pImage = &aImgImported;
-        else if( pEntry->IsReadOnly() )
+        if( pEntry->IsReadOnly() )
             pImage = &aImgReadOnly;
         else if( pEntry->IsDefault() )
             pImage = &aImgDefault;
@@ -267,11 +264,6 @@ void GalleryBrowser1::ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec)
 
         if( pTheme->IsReadOnly() )
             bUpdateAllowed = bRenameAllowed = bRemoveAllowed = sal_False;
-        else if( pTheme->IsImported() )
-        {
-            bUpdateAllowed = sal_False;
-            bRenameAllowed = bRemoveAllowed = sal_True;
-        }
         else if( pTheme->IsDefault() )
         {
             bUpdateAllowed = bRenameAllowed = sal_True;
@@ -289,7 +281,7 @@ void GalleryBrowser1::ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec)
         if( bRemoveAllowed )
             o_aExec.push_back( MN_DELETE );
 
-        if( bIdDialog && !pTheme->IsReadOnly() && !pTheme->IsImported() )
+        if( bIdDialog && !pTheme->IsReadOnly() )
             o_aExec.push_back( MN_ASSIGN_ID );
 
         o_aExec.push_back( MN_PROPERTIES );
@@ -465,7 +457,7 @@ void GalleryBrowser1::ImplExecute( sal_uInt16 nId )
         {
             GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), *this );
 
-            if( pTheme && !pTheme->IsReadOnly() && !pTheme->IsImported() )
+            if (pTheme && !pTheme->IsReadOnly())
             {
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 6a673f5..287a188 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -460,7 +460,7 @@ sal_Int8 GalleryBrowser2::AcceptDrop( DropTargetHelper& rTarget, const AcceptDro
 {
     sal_Int8 nRet = DND_ACTION_NONE;
 
-    if( mpCurTheme && !mpCurTheme->IsReadOnly() && !mpCurTheme ->IsImported() )
+    if( mpCurTheme && !mpCurTheme->IsReadOnly() )
     {
         if( !mpCurTheme->IsDragging() )
         {
@@ -1092,18 +1092,9 @@ void GalleryBrowser2::ImplExecute( sal_uInt16 nId )
 
 String GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj, sal_uIntPtr nItemTextFlags )
 {
-    INetURLObject   aURL;
     String          aRet;
 
-    if( rTheme.IsImported() )
-    {
-        aURL = rTheme.GetParent()->GetImportURL( rTheme.GetName() );
-
-        aURL.removeSegment();
-        aURL.Append( rObj.GetURL().GetName() );
-    }
-    else
-        aURL = rObj.GetURL();
+    INetURLObject aURL(rObj.GetURL());
 
     if( nItemTextFlags & GALLERY_ITEM_THEMENAME )
     {
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 2a00e5c..c803c58 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -692,7 +692,7 @@ sal_Int8 GalleryListView::AcceptDrop( const BrowserAcceptDropEvent& )
 {
     sal_Int8 nRet = DND_ACTION_NONE;
 
-    if( mpTheme && !mpTheme->IsReadOnly() && !mpTheme ->IsImported() )
+    if( mpTheme && !mpTheme->IsReadOnly() )
         nRet = DND_ACTION_COPY;
 
     return nRet;
diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src
index b801b1d..6bb583a 100644
--- a/svx/source/gallery2/gallery.src
+++ b/svx/source/gallery2/gallery.src
@@ -190,11 +190,6 @@ Bitmap RID_SVXBMP_THEME_NORMAL
     File = "galnors.bmp" ;
 };
 
-Bitmap RID_SVXBMP_THEME_IMPORTED
-{
-    File = "galimps.bmp" ;
-};
-
 Bitmap RID_SVXBMP_THEME_READONLY
 {
     File = "galrdos.bmp" ;
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index b00d02a..f50b3c6 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -53,12 +53,11 @@ using namespace ::com::sun::star;
 // ---------------------
 
 GalleryThemeEntry::GalleryThemeEntry( const INetURLObject& rBaseURL, const String& rName,
-                                      sal_uInt32 _nFileNumber, sal_Bool _bReadOnly, sal_Bool _bImported,
+                                      sal_uInt32 _nFileNumber, sal_Bool _bReadOnly,
                                       sal_Bool _bNewFile, sal_uInt32 _nId, sal_Bool _bThemeNameFromResource ) :
         nFileNumber                             ( _nFileNumber ),
         nId                                     ( _nId ),
-        bReadOnly                               ( _bReadOnly || _bImported ),
-        bImported                               ( _bImported ),
+        bReadOnly                               ( _bReadOnly ),
         bThemeNameFromResource  ( _bThemeNameFromResource )
 {
     INetURLObject aURL( rBaseURL );
@@ -136,7 +135,7 @@ SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry )
     write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rEntry.aThemeName, RTL_TEXTENCODING_UTF8);
     write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rEntry.aUIName, RTL_TEXTENCODING_UTF8);
     write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, (rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8);
-    write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rEntry.aImportName, RTL_TEXTENCODING_UTF8);
+    write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rtl::OUString(), RTL_TEXTENCODING_UTF8); //aImportName
 
     write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOut, rtl::OString());
     return rOut;
@@ -149,7 +148,7 @@ SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry )
     rEntry.aThemeName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8);
     rEntry.aUIName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8);
     rEntry.aURL = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8);
-    rEntry.aImportName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8);
+    read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8); //aImportName
     read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIn);
     return rIn;
 }
@@ -254,8 +253,6 @@ void Gallery::ImplLoad( const rtl::OUString& rMultiPath )
 
     DBG_ASSERT( aUserURL.GetProtocol() != INET_PROT_NOT_VALID, "no writable Gallery user directory available" );
     DBG_ASSERT( aRelURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
-    ImplLoadImports();
 }
 
 // ------------------------------------------------------------------------
@@ -454,85 +451,6 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
 
 // ------------------------------------------------------------------------
 
-void Gallery::ImplLoadImports()
-{
-    INetURLObject aURL( GetUserURL() );
-
-    aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( "gallery.sdi" ) ) );
-
-    if( FileExists( aURL ) )
-    {
-        SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
-
-        if( pIStm )
-        {
-            GalleryThemeEntry*          pThemeEntry;
-            GalleryImportThemeEntry*    pImportEntry;
-            INetURLObject               aFile;
-            sal_uInt32                      nInventor;
-            sal_uInt32                      nCount;
-            sal_uInt16                      nId;
-            sal_uInt16                      i;
-            sal_uInt16                      nTempCharSet;
-
-            for ( size_t j = 0, n = aImportList.size(); j < n; ++j )
-                delete aImportList[ j ];
-            aImportList.clear();
-
-            *pIStm >> nInventor;
-
-            if( nInventor == COMPAT_FORMAT( 'S', 'G', 'A', '3' ) )
-            {
-                *pIStm >> nId >> nCount >> nTempCharSet;
-
-                for( i = 0; i < nCount; i++ )
-                {
-                    pImportEntry = new GalleryImportThemeEntry;
-
-                    *pIStm >> *pImportEntry;
-                    aImportList.push_back( pImportEntry );
-                    aFile = INetURLObject( pImportEntry->aURL );
-                    pThemeEntry = new GalleryThemeEntry( aFile,
-                                                         pImportEntry->aUIName,
-                                                         String(aFile.GetBase()).Erase( 0, 2 ).Erase( 6 ).ToInt32(),
-                                                         sal_True, sal_True, sal_False, 0, sal_False );
-
-                    aThemeList.push_back( pThemeEntry );
-                }
-            }
-
-            delete pIStm;
-        }
-    }
-}
-
-// ------------------------------------------------------------------------
-
-void Gallery::ImplWriteImportList()
-{
-    INetURLObject aURL( GetUserURL() );
-    aURL.Append( ( String( "gallery.sdi", RTL_TEXTENCODING_UTF8 ) ) );
-    SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC );
-
-    if( pOStm )
-    {
-        const sal_uInt32 nInventor = (sal_uInt32) COMPAT_FORMAT( 'S', 'G', 'A', '3' );
-        const sal_uInt16 nId = 0x0004;
-
-        *pOStm << nInventor << nId << (sal_uInt32) aImportList.size() << (sal_uInt16) osl_getThreadTextEncoding();
-
-        for ( size_t i = 0, n = aImportList.size(); i < n; ++i )
-            *pOStm << *aImportList[ i ];
-
-        if( pOStm->GetError() )
-            ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
-
-        delete pOStm;
-    }
-}
-
-// ------------------------------------------------------------------------
-
 GalleryThemeEntry* Gallery::ImplGetThemeEntry( const rtl::OUString& rThemeName )
 {
     GalleryThemeEntry* pFound = NULL;
@@ -632,7 +550,7 @@ sal_Bool Gallery::CreateTheme( const String& rThemeName, sal_uInt32 nNumFrom )
         nLastFileNumber = nNumFrom > nLastFileNumber ? nNumFrom : nLastFileNumber + 1;
         GalleryThemeEntry* pNewEntry = new GalleryThemeEntry( GetUserURL(), rThemeName,
                                                               nLastFileNumber,
-                                                              sal_False, sal_False, sal_True, 0, sal_False );
+                                                              sal_False, sal_True, 0, sal_False );
 
         aThemeList.push_back( pNewEntry );
         delete( new GalleryTheme( this, pNewEntry ) );
@@ -651,7 +569,7 @@ sal_Bool Gallery::RenameTheme( const String& rOldName, const String& rNewName )
     sal_Bool                            bRet = sal_False;
 
     // Ueberpruefen, ob neuer Themenname schon vorhanden ist
-    if( pThemeEntry && !HasTheme( rNewName ) && ( !pThemeEntry->IsReadOnly() || pThemeEntry->IsImported() ) )
+    if( pThemeEntry && !HasTheme( rNewName ) && !pThemeEntry->IsReadOnly() )
     {
         SfxListener   aListener;
         GalleryTheme* pThm = AcquireTheme( rOldName, aListener );
@@ -663,19 +581,6 @@ sal_Bool Gallery::RenameTheme( const String& rOldName, const String& rNewName )
             pThemeEntry->SetName( rNewName );
             pThm->ImplWrite();
 
-            if( pThemeEntry->IsImported() )
-            {
-                pThm->SetImportName( rNewName );
-
-                GalleryImportThemeEntry* pImportEntry = ImplGetImportThemeEntry( rOldName );
-
-                if( pImportEntry )
-                {
-                    pImportEntry->aUIName = rNewName;
-                    ImplWriteImportList();
-                }
-            }
-
             Broadcast( GalleryHint( GALLERY_HINT_THEME_RENAMED, aOldName, pThm->GetName() ) );
             ReleaseTheme( pThm, aListener );
             bRet = sal_True;
@@ -692,44 +597,24 @@ sal_Bool Gallery::RemoveTheme( const String& rThemeName )
     GalleryThemeEntry*  pThemeEntry = ImplGetThemeEntry( rThemeName );
     sal_Bool                bRet = sal_False;
 
-    if( pThemeEntry && ( !pThemeEntry->IsReadOnly() || pThemeEntry->IsImported() ) )
+    if( pThemeEntry && !pThemeEntry->IsReadOnly() )
     {
         Broadcast( GalleryHint( GALLERY_HINT_CLOSE_THEME, rThemeName ) );
 
-        if( pThemeEntry->IsImported() )
-        {
-            GalleryImportThemeEntry* pImportEntry = ImplGetImportThemeEntry( rThemeName );
+        SfxListener     aListener;
+        GalleryTheme*   pThm = AcquireTheme( rThemeName, aListener );
 
-            if( pImportEntry )
-            {
-                for ( GalleryImportThemeList::iterator it = aImportList.begin(); it != aImportList.end(); ++it )
-                {
-                    if ( *it == pImportEntry )
-                    {
-                        delete pImportEntry;
-                        aImportList.erase( it );
-                        break;
-                    }
-                }
-            }
-        }
-        else
+        if( pThm )
         {
-            SfxListener     aListener;
-            GalleryTheme*   pThm = AcquireTheme( rThemeName, aListener );
-
-            if( pThm )
-            {
-                INetURLObject   aThmURL( pThm->GetThmURL() );
-                INetURLObject   aSdgURL( pThm->GetSdgURL() );
-                INetURLObject   aSdvURL( pThm->GetSdvURL() );
+            INetURLObject   aThmURL( pThm->GetThmURL() );
+            INetURLObject   aSdgURL( pThm->GetSdgURL() );
+            INetURLObject   aSdvURL( pThm->GetSdvURL() );
 
-                ReleaseTheme( pThm, aListener );
+            ReleaseTheme( pThm, aListener );
 
-                KillFile( aThmURL );
-                KillFile( aSdgURL );
-                KillFile( aSdvURL );
-            }
+            KillFile( aThmURL );
+            KillFile( aSdgURL );
+            KillFile( aSdvURL );
         }
 
         for ( GalleryThemeList::iterator it = aThemeList.begin(); it != aThemeList.end(); ++it )
@@ -784,12 +669,7 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
 
         if( !pTheme )
         {
-            INetURLObject aURL;
-
-            if( !pThemeEntry->IsImported() )
-                aURL = pThemeEntry->GetThmURL();
-            else
-                aURL = GetImportURL( pThemeEntry->GetThemeName() );
+            INetURLObject aURL = pThemeEntry->GetThmURL();
 
             DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
 
@@ -803,9 +683,9 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
                     *pIStm >> *pTheme;
 
                     if( pIStm->GetError() )
+                    {
                         delete pTheme, pTheme = NULL;
-                    else if( pThemeEntry->IsImported() )
-                        pTheme->SetImportName( pThemeEntry->GetThemeName() );
+                    }
 
                     delete pIStm;
                 }
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 27caa5f..e82289d 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -79,9 +79,6 @@ GalleryTheme::GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry )
         bDragging             ( sal_False )
 {
     ImplCreateSvDrawStorage();
-
-    if( pThm->IsImported() )
-        aImportName = pThm->GetThemeName();
 }
 
 // ------------------------------------------------------------------------
@@ -104,15 +101,10 @@ GalleryTheme::~GalleryTheme()
 
 void GalleryTheme::ImplCreateSvDrawStorage()
 {
-    if( !pThm->IsImported() )
-    {
-        aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE );
-        // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons)
-        if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() )
-            aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
-    }
-    else
-        aSvDrawStorageRef.Clear();
+    aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE );
+    // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons)
+    if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() )
+        aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
 }
 
 // ------------------------------------------------------------------------
@@ -256,19 +248,7 @@ INetURLObject GalleryTheme::ImplGetURL( const GalleryObject* pObject ) const
     INetURLObject aURL;
 
     if( pObject )
-    {
-        if( IsImported() )
-        {
-            INetURLObject aPathURL( GetParent()->GetImportURL( GetName() ) );
-
-            aPathURL.removeSegment();
-            aPathURL.removeFinalSlash();
-            aPathURL.Append( pObject->aURL.GetName() );
-            aURL = aPathURL;
-        }
-        else
-            aURL = pObject->aURL;
-    }
+        aURL = pObject->aURL;
 
     return aURL;
 }
@@ -536,7 +516,7 @@ bool GalleryTheme::ChangeObjectPos( size_t nOldPos, size_t nNewPos )
 
 void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProgress )
 {
-    if( !IsReadOnly() && !IsImported() )
+    if( !IsReadOnly() )
     {
         Graphic         aGraphic;
         String          aFormat;
@@ -778,7 +758,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa
                 aPathURL.removeFinalSlash();
                 pRet = new GalleryThemeEntry( aPathURL, aThemeName,
                                               String(rURL.GetBase()).Copy( 2, 6 ).ToInt32(),
-                                              bReadOnly, sal_False, sal_False, nThemeId,
+                                              bReadOnly, sal_False, nThemeId,
                                               bThemeNameFromResource );
             }
 
@@ -1432,7 +1412,6 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
     String              aThemeName;
     rtl_TextEncoding    nTextEncoding;
 
-    aImportName = rtl::OUString();
     rIStm >> nVersion;
     rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm);
     rIStm >> nCount;
@@ -1587,11 +1566,10 @@ const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL();
 sal_uInt32 GalleryTheme::GetId() const { return pThm->GetId(); }
 void GalleryTheme::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName ) { pThm->SetId( nNewId, bResetThemeName ); }
 sal_Bool GalleryTheme::IsThemeNameFromResource() const { return pThm->IsNameFromResource(); }
-sal_Bool GalleryTheme::IsImported() const { return pThm->IsImported(); }
 sal_Bool GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); }
 sal_Bool GalleryTheme::IsDefault() const { return pThm->IsDefault(); }
 sal_Bool GalleryTheme::IsModified() const { return pThm->IsModified(); }
-const rtl::OUString& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
+const rtl::OUString& GalleryTheme::GetName() const { return pThm->GetThemeName(); }
 
 void GalleryTheme::InsertAllThemes( ListBox& rListBox )
 {
commit 995b97632e3e6f0a789f0ee59fc3bcc6f24bf096
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 16 08:46:07 2012 +0100

    make gtk-print stuff build on gtk+2 2.12.0
    
    Change-Id: Ifad0e87522397bace62ac8203202a3f40031b5f7

diff --git a/vcl/unx/gtk/inc/gtkprintwrapper.hxx b/vcl/unx/gtk/inc/gtkprintwrapper.hxx
index 8457430..3341d53 100644
--- a/vcl/unx/gtk/inc/gtkprintwrapper.hxx
+++ b/vcl/unx/gtk/inc/gtkprintwrapper.hxx
@@ -38,7 +38,9 @@
 #if GTK_CHECK_VERSION(2,14,0)
 #include <gtk/gtkunixprint.h>
 #else
+#include <gtk/gtkprintjob.h>
 #include <gtk/gtkpagesetupunixdialog.h>
+#include <gtk/gtkprintunixdialog.h>
 #endif
 
 #if !GTK_CHECK_VERSION(3,0,0)


More information about the Libreoffice-commits mailing list