summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-01-03 16:09:12 +0000
committerOliver Bolte <obo@openoffice.org>2005-01-03 16:09:12 +0000
commit326adb64dffcb500609bd0147c7c99965cc189bd (patch)
treec3e4a37e5e91163ed34379e64365d66397508408 /tools
parentb0b8659e11d83d9a6884995f6acc807286cff5b0 (diff)
INTEGRATION: CWS res32bit (1.4.232); FILE MERGED
2004/11/17 18:19:40 pl 1.4.232.1: #i34300# implemented emergency case if no fallback can be found
Diffstat (limited to 'tools')
-rw-r--r--tools/source/string/strucvt.cxx52
1 files changed, 50 insertions, 2 deletions
diff --git a/tools/source/string/strucvt.cxx b/tools/source/string/strucvt.cxx
index cc771af75311..31b01189aafd 100644
--- a/tools/source/string/strucvt.cxx
+++ b/tools/source/string/strucvt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: strucvt.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 17:04:53 $
+ * last change: $Author: obo $ $Date: 2005-01-03 17:09:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -182,3 +182,51 @@ UniString& UniString::Assign( const rtl::OUString& rStr )
ImplIncRefCount( mpData );
return *this;
}
+
+// =======================================================================
+
+#ifndef _TOOLS_RC_HXX
+#include <rc.hxx>
+#endif
+#ifndef _TOOLS_RCID_H
+#include <rcid.h>
+#endif
+
+UniString::UniString( const ResId& rResId )
+{
+ rResId.SetRT( RSC_STRING );
+ ResMgr* pResMgr = rResId.GetResMgr();
+ if ( !pResMgr )
+ pResMgr = Resource::GetResManager();
+
+ mpData = NULL;
+ if ( pResMgr->GetResource( rResId ) )
+ {
+ // String laden
+ RSHEADER_TYPE * pResHdr = (RSHEADER_TYPE*)pResMgr->GetClass();
+ //sal_uInt32 nLen = pResHdr->GetLocalOff() - sizeof( RSHEADER_TYPE );
+
+ sal_uInt32 nStringLen = strlen( (char*)(pResHdr+1) );
+ InitStringRes( (const char*)(pResHdr+1), nStringLen );
+
+ sal_uInt32 nSize = sizeof( RSHEADER_TYPE ) + nStringLen + 1;
+ nSize += nSize % 2;
+ pResMgr->Increment( nSize );
+ }
+ else
+ {
+ mpData = &aImplEmptyStrData;
+ ImplIncRefCount( mpData );
+ #if OSL_DEBUG_LEVEL > 0
+ *this = UniString::CreateFromAscii( "<resource id " );
+ Append( UniString::CreateFromInt32( rResId.GetId() ) );
+ AppendAscii( " not found>" );
+ #endif
+ }
+
+
+ ResHookProc pImplResHookProc = ResMgr::GetReadStringHook();
+ if ( pImplResHookProc )
+ pImplResHookProc( *this );
+}
+