summaryrefslogtreecommitdiff
path: root/svx/source/gallery2/galobj.cxx
diff options
context:
space:
mode:
authorSven Jacobi <sj@openoffice.org>2002-10-29 14:26:02 +0000
committerSven Jacobi <sj@openoffice.org>2002-10-29 14:26:02 +0000
commit0303a0e7a3599088a98bed5a6e9350e1c8ca8430 (patch)
tree31f469f5104de8ba63bd5d840774f08d98eca04e /svx/source/gallery2/galobj.cxx
parent37472d5b4ce943c5dda05e577b86c7a7cedde41d (diff)
#104500# titles of SgaObjects are now localizeable
Diffstat (limited to 'svx/source/gallery2/galobj.cxx')
-rw-r--r--svx/source/gallery2/galobj.cxx47
1 files changed, 45 insertions, 2 deletions
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 526c2bec1cfa..7929cac3d787 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: galobj.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: ka $ $Date: 2001-11-14 12:59:55 $
+ * last change: $Author: sj $ $Date: 2002-10-29 15:26:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,7 @@
#define ENABLE_BYTESTRING_STREAM_OPERATORS
+#include <tools/rcid.h>
#include <tools/vcompat.hxx>
#include <vcl/virdev.hxx>
#include <svtools/itempool.hxx>
@@ -182,6 +183,48 @@ void SgaObject::ReadData(SvStream& rIn, UINT16& rReadVersion )
// ------------------------------------------------------------------------
+const String SgaObject::GetTitle() const
+{
+ String aReturnValue( aTitle );
+ if ( !getenv( "GALLERY_SHOW_PRIVATE_TITLE" ) )
+ {
+ if ( aReturnValue.GetTokenCount( ':' ) == 3 )
+ {
+ String aPrivateInd ( aReturnValue.GetToken( 0, ':' ) );
+ String aResourceName( aReturnValue.GetToken( 1, ':' ) );
+ sal_Int32 nResId ( aReturnValue.GetToken( 2, ':' ).ToInt32() );
+ if ( aReturnValue.GetToken( 0, ':' ).EqualsAscii( "private" ) &&
+ aResourceName.Len() && ( nResId > 0 ) && ( nResId < 0x10000 ) )
+ {
+ ByteString aMgrName( aResourceName, RTL_TEXTENCODING_UTF8 );
+ aMgrName += ByteString::CreateFromInt32( SOLARUPD );
+ ResMgr* pResMgr = ResMgr::CreateResMgr( aMgrName.GetBuffer(),
+ Application::GetSettings().GetUILanguage() );
+ if ( pResMgr )
+ {
+ ResId aResId( (sal_uInt16)nResId, pResMgr );
+ aResId.SetRT( RSC_STRING );
+ if ( pResMgr->IsAvailable( aResId ) )
+ {
+ aReturnValue = String( aResId );
+ }
+ delete pResMgr;
+ }
+ }
+ }
+ }
+ return aReturnValue;
+}
+
+// ------------------------------------------------------------------------
+
+void SgaObject::SetTitle( const String& rTitle )
+{
+ aTitle = rTitle;
+}
+
+// ------------------------------------------------------------------------
+
SvStream& operator<<( SvStream& rOut, const SgaObject& rObj )
{
rObj.WriteData( rOut );