summaryrefslogtreecommitdiffstats
path: root/svx/source/gallery2
diff options
context:
space:
mode:
authorOcke.Janssen@oracle.com <Ocke.Janssen@oracle.com>2011-12-06 01:28:00 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-06 09:39:08 +0100
commit9753031300bb9bd61bbba2f617900422cdbde1ff (patch)
tree3145fbd0b22e89a0ae9607e90ac5d58043784d33 /svx/source/gallery2
parentimpress210: #i115617# set zoom to fit_to_window (diff)
downloadcore-9753031300bb9bd61bbba2f617900422cdbde1ff.tar.gz
core-9753031300bb9bd61bbba2f617900422cdbde1ff.zip
impress210: #i105310# set tooltip for items and some refactoring
# HG changeset patch # User Ocke.Janssen@oracle.com # Date 1297164555 -3600 # Node ID 902597eed5414555107034f62583c4ccc2cdfd4b # Parent 2f0f385e8b25938777bb9fed6a86a2ff43e0b7cd impress210: #i105310# set tooltip for items and some refactoring
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r--svx/source/gallery2/galbrws1.cxx23
-rw-r--r--svx/source/gallery2/galbrws1.hxx2
-rw-r--r--svx/source/gallery2/galctrl.cxx2
-rw-r--r--svx/source/gallery2/gallery1.cxx23
-rw-r--r--svx/source/gallery2/galtheme.cxx15
5 files changed, 31 insertions, 34 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 4c50608b0369..fc20022bcf93 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -256,9 +256,8 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa
// -----------------------------------------------------------------------------
-::std::vector< sal_uInt16 > GalleryBrowser1::ImplGetExecuteVector()
+void GalleryBrowser1::ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec)
{
- ::std::vector< sal_uInt16 > aExecVector;
GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), *this );
if( pTheme )
@@ -282,23 +281,21 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa
bUpdateAllowed = bRenameAllowed = bRemoveAllowed = sal_True;
if( bUpdateAllowed && pTheme->GetObjectCount() )
- aExecVector.push_back( MN_ACTUALIZE );
+ o_aExec.push_back( MN_ACTUALIZE );
if( bRenameAllowed )
- aExecVector.push_back( MN_RENAME );
+ o_aExec.push_back( MN_RENAME );
if( bRemoveAllowed )
- aExecVector.push_back( MN_DELETE );
+ o_aExec.push_back( MN_DELETE );
if( bIdDialog && !pTheme->IsReadOnly() && !pTheme->IsImported() )
- aExecVector.push_back( MN_ASSIGN_ID );
+ o_aExec.push_back( MN_ASSIGN_ID );
- aExecVector.push_back( MN_PROPERTIES );
+ o_aExec.push_back( MN_PROPERTIES );
mpGallery->ReleaseTheme( pTheme, *this );
}
-
- return aExecVector;
}
// -----------------------------------------------------------------------------
@@ -585,7 +582,8 @@ sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
if( !bRet )
{
- ::std::vector< sal_uInt16 > aExecVector( ImplGetExecuteVector() );
+ ::std::vector< sal_uInt16 > aExecVector;
+ ImplGetExecuteVector(aExecVector);
sal_uInt16 nExecuteId = 0;
sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
@@ -649,9 +647,10 @@ sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
IMPL_LINK( GalleryBrowser1, ShowContextMenuHdl, void*, EMPTYARG )
{
- ::std::vector< sal_uInt16 > aExecVector( ImplGetExecuteVector() );
+ ::std::vector< sal_uInt16 > aExecVector;
+ ImplGetExecuteVector(aExecVector);
- if( aExecVector.size() )
+ if( !aExecVector.empty() )
{
PopupMenu aMenu( GAL_RESID( RID_SVXMN_GALLERY1 ) );
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 10b7606de2cc..5441b1fc6cf7 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -102,7 +102,7 @@ private:
void ImplAdjustControls();
sal_uIntPtr ImplInsertThemeEntry( const GalleryThemeEntry* pEntry );
void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData );
- ::std::vector< sal_uInt16 > ImplGetExecuteVector();
+ void ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec);
void ImplExecute( sal_uInt16 nId );
void ImplGalleryThemeProperties( const String & rThemeName, bool bCreateNew );
void ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog, bool bCreateNew );
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 84b27b76127d..72a481e67691 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -401,7 +401,7 @@ void GalleryIconView::UserDraw( const UserDrawEvent& rUDEvt )
aGraphic.Draw( pDev, aPos, aSize );
}
- SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_THEMENAME | GALLERY_ITEM_TITLE | GALLERY_ITEM_PATH ) );
+ SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE) );
mpTheme->ReleaseObject( pObj );
}
}
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 773a03e43a06..4c10186cac9b 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -326,16 +326,19 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
if( xContentAccess.is() )
{
+ static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"));
+ static const ::rtl::OUString s_sIsReadOnly(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly"));
+ static const ::rtl::OUString s_sSDG_EXT(RTL_CONSTASCII_USTRINGPARAM("sdg"));
+ static const ::rtl::OUString s_sSDV_EXT(RTL_CONSTASCII_USTRINGPARAM("sdv"));
+
while( xResultSet->next() )
{
INetURLObject aThmURL( xContentAccess->queryContentIdentifierString() );
if(aThmURL.GetExtension().equalsIgnoreAsciiCaseAscii("thm"))
{
- INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( OUString(RTL_CONSTASCII_USTRINGPARAM("sdg")) );
- INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( OUString(RTL_CONSTASCII_USTRINGPARAM("sdv")) );
- const OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM("Title") );
- const OUString aReadOnlyProp( RTL_CONSTASCII_USTRINGPARAM("IsReadOnly") );
+ INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( s_sSDG_EXT );
+ INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( s_sSDV_EXT );
OUString aTitle;
sal_Bool bReadOnly = sal_False;
@@ -347,7 +350,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
try
{
- aThmCnt.getPropertyValue( aTitleProp ) >>= aTitle;
+ aThmCnt.getPropertyValue( s_sTitle ) >>= aTitle;
}
catch( const uno::RuntimeException& )
{
@@ -360,7 +363,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
{
try
{
- aThmCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly;
+ aThmCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly;
}
catch( const uno::RuntimeException& )
{
@@ -373,7 +376,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
{
try
{
- aSdgCnt.getPropertyValue( aTitleProp ) >>= aTitle;
+ aSdgCnt.getPropertyValue( s_sTitle ) >>= aTitle;
}
catch( const ::com::sun::star::uno::RuntimeException& )
{
@@ -386,7 +389,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
{
try
{
- aSdgCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly;
+ aSdgCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly;
}
catch( const uno::RuntimeException& )
{
@@ -401,7 +404,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
{
try
{
- aSdvCnt.getPropertyValue( aTitleProp ) >>= aTitle;
+ aSdvCnt.getPropertyValue( s_sTitle ) >>= aTitle;
}
catch( const ::com::sun::star::uno::RuntimeException& )
{
@@ -414,7 +417,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
{
try
{
- aSdvCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly;
+ aSdvCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly;
}
catch( const uno::RuntimeException& )
{
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 8741d5adb7ee..12f1e6d257ab 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -1191,18 +1191,13 @@ sal_Bool GalleryTheme::InsertFileOrDirURL( const INetURLObject& rFileOrDirURL, s
uno::Sequence< OUString > aProps( 1 );
aProps.getArray()[ 0 ] = OUString(RTL_CONSTASCII_USTRINGPARAM("Url"));
uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
-
- if( xResultSet.is() )
+ uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
+ if( xContentAccess.is() )
{
- uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
-
- if( xContentAccess.is() )
+ while( xResultSet->next() )
{
- while( xResultSet->next() )
- {
- aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() );
- aURLVector.push_back( aURL );
- }
+ aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() );
+ aURLVector.push_back( aURL );
}
}
}