Kaydet (Commit) 3994dd5e authored tarafından Noel Grandin's avatar Noel Grandin

convert include/svtools/insdlg.hxx from String to OUString

Change-Id: I72c5e3e47040e78976f46f585b50ab6c12f84986
üst a067546d
...@@ -102,7 +102,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -102,7 +102,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
pFormats = &rHelper.GetDataFlavorExVector(); pFormats = &rHelper.GetDataFlavorExVector();
// create and fill dialog box // create and fill dialog box
String aSourceName, aTypeName; OUString aSourceName, aTypeName;
sal_uLong nSelFormat = 0; sal_uLong nSelFormat = 0;
SvGlobalName aEmptyNm; SvGlobalName aEmptyNm;
...@@ -115,19 +115,19 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -115,19 +115,19 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
::com::sun::star::datatransfer::DataFlavor aFlavor( *aIter ); ::com::sun::star::datatransfer::DataFlavor aFlavor( *aIter );
SotFormatStringId nFormat = (*aIter++).mnSotId; SotFormatStringId nFormat = (*aIter++).mnSotId;
::std::map< SotFormatStringId, String >::iterator itName = ::std::map< SotFormatStringId, OUString >::iterator itName =
aSupplementMap.find( nFormat ); aSupplementMap.find( nFormat );
// if there is an "Embed Source" or and "Embedded Object" on the // if there is an "Embed Source" or and "Embedded Object" on the
// Clipboard we read the Description and the Source of this object // Clipboard we read the Description and the Source of this object
// from an accompanied "Object Descriptor" format on the clipboard // from an accompanied "Object Descriptor" format on the clipboard
// Remember: these formats mostly appear together on the clipboard // Remember: these formats mostly appear together on the clipboard
String aName; OUString aName;
const String* pName = NULL; const OUString* pName = NULL;
if ( itName == aSupplementMap.end() ) if ( itName == aSupplementMap.end() )
{ {
SvPasteObjectHelper::GetEmbeddedName(rHelper,aName,aSourceName,nFormat); SvPasteObjectHelper::GetEmbeddedName(rHelper,aName,aSourceName,nFormat);
if ( aName.Len() ) if ( !aName.isEmpty() )
pName = &aName; pName = &aName;
} }
else else
...@@ -155,7 +155,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -155,7 +155,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
{ {
continue; continue;
} }
else if( !aName.Len() ) else if( aName.isEmpty() )
aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat ); aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat );
if( LISTBOX_ENTRY_NOTFOUND == ObjectLB().GetEntryPos( aName ) ) if( LISTBOX_ENTRY_NOTFOUND == ObjectLB().GetEntryPos( aName ) )
...@@ -164,7 +164,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -164,7 +164,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
} }
} }
if( !aTypeName.Len() && !aSourceName.Len() ) if( aTypeName.isEmpty() && aSourceName.isEmpty() )
{ {
if( aDesc.maClassName != aEmptyNm ) if( aDesc.maClassName != aEmptyNm )
{ {
...@@ -172,7 +172,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -172,7 +172,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
aTypeName = aDesc.maTypeName; aTypeName = aDesc.maTypeName;
} }
if( !aTypeName.Len() && !aSourceName.Len() ) if( aTypeName.isEmpty() && aSourceName.isEmpty() )
{ {
ResMgr* pMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() ); ResMgr* pMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() );
// global resource from svtools (former so3 resource) // global resource from svtools (former so3 resource)
...@@ -185,10 +185,10 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, ...@@ -185,10 +185,10 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
ObjectLB().SetUpdateMode( sal_True ); ObjectLB().SetUpdateMode( sal_True );
SelectObject(); SelectObject();
if( aSourceName.Len() ) if( !aSourceName.isEmpty() )
{ {
if( aTypeName.Len() ) if( !aTypeName.isEmpty() )
aTypeName += '\n'; aTypeName += "\n";
aTypeName += aSourceName; aTypeName += aSourceName;
aTypeName = convertLineEnd(aTypeName, GetSystemLineEnd()); aTypeName = convertLineEnd(aTypeName, GetSystemLineEnd());
......
...@@ -42,7 +42,7 @@ class SvPasteObjectDialog : public ModalDialog ...@@ -42,7 +42,7 @@ class SvPasteObjectDialog : public ModalDialog
FixedText* m_pFtObjectSource; FixedText* m_pFtObjectSource;
ListBox* m_pLbInsertList; ListBox* m_pLbInsertList;
OKButton* m_pOKButton; OKButton* m_pOKButton;
::std::map< SotFormatStringId, String > aSupplementMap; ::std::map< SotFormatStringId, OUString > aSupplementMap;
SvGlobalName aObjClassName; SvGlobalName aObjClassName;
String aObjName; String aObjName;
......
...@@ -33,15 +33,15 @@ class SvObjectServer ...@@ -33,15 +33,15 @@ class SvObjectServer
{ {
private: private:
SvGlobalName aClassName; SvGlobalName aClassName;
String aHumanName; OUString aHumanName;
public: public:
SvObjectServer( const SvGlobalName & rClassP, const String & rHumanP ) : SvObjectServer( const SvGlobalName & rClassP, const OUString & rHumanP ) :
aClassName( rClassP ), aClassName( rClassP ),
aHumanName( rHumanP ) {} aHumanName( rHumanP ) {}
const SvGlobalName & GetClassName() const { return aClassName; } const SvGlobalName & GetClassName() const { return aClassName; }
const String & GetHumanName() const { return aHumanName; } const OUString & GetHumanName() const { return aHumanName; }
}; };
typedef ::std::vector< SvObjectServer > SvObjectServerList_impl; typedef ::std::vector< SvObjectServer > SvObjectServerList_impl;
...@@ -52,7 +52,7 @@ private: ...@@ -52,7 +52,7 @@ private:
SvObjectServerList_impl aObjectServerList; SvObjectServerList_impl aObjectServerList;
public: public:
const SvObjectServer * Get( const String & rHumanName ) const; const SvObjectServer * Get( const OUString & rHumanName ) const;
const SvObjectServer * Get( const SvGlobalName & ) const; const SvObjectServer * Get( const SvGlobalName & ) const;
void Remove( const SvGlobalName & ); void Remove( const SvGlobalName & );
void FillInsertObjects(); void FillInsertObjects();
...@@ -70,8 +70,8 @@ public: ...@@ -70,8 +70,8 @@ public:
class SVT_DLLPUBLIC SvPasteObjectHelper class SVT_DLLPUBLIC SvPasteObjectHelper
{ {
public: public:
static String GetSotFormatUIName( SotFormatStringId nId ); static OUString GetSotFormatUIName( SotFormatStringId nId );
static sal_Bool GetEmbeddedName(const TransferableDataHelper& rData, String& _rName, String& _rSource, SotFormatStringId& _nFormat); static sal_Bool GetEmbeddedName(const TransferableDataHelper& rData, OUString& _rName, OUString& _rSource, SotFormatStringId& _nFormat);
}; };
#endif // _SVTOOLS_INSDLG_HXX #endif // _SVTOOLS_INSDLG_HXX
......
...@@ -345,7 +345,7 @@ static sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const Transferabl ...@@ -345,7 +345,7 @@ static sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const Transferabl
// translated format name strings are no longer inserted here, // translated format name strings are no longer inserted here,
// handled by "paste special" dialog / toolbox controller instead. // handled by "paste special" dialog / toolbox controller instead.
// Only the object type name has to be set here: // Only the object type name has to be set here:
String aStrVal; OUString aStrVal;
if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE ) if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE )
{ {
TransferableObjectDescriptor aDesc; TransferableObjectDescriptor aDesc;
...@@ -356,11 +356,11 @@ static sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const Transferabl ...@@ -356,11 +356,11 @@ static sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const Transferabl
else if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE else if ( nFormatId == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE
|| nFormatId == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) || nFormatId == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE )
{ {
String aSource; OUString aSource;
SvPasteObjectHelper::GetEmbeddedName( rDataHelper, aStrVal, aSource, nFormatId ); SvPasteObjectHelper::GetEmbeddedName( rDataHelper, aStrVal, aSource, nFormatId );
} }
if ( aStrVal.Len() ) if ( !aStrVal.isEmpty() )
rFormats.AddClipbrdFormat( nFormatId, aStrVal ); rFormats.AddClipbrdFormat( nFormatId, aStrVal );
else else
rFormats.AddClipbrdFormat( nFormatId ); rFormats.AddClipbrdFormat( nFormatId );
......
...@@ -162,8 +162,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH ...@@ -162,8 +162,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
} }
if (bHasFormat) if (bHasFormat)
{ {
String sName; OUString sName;
String sSource; OUString sSource;
if (SvPasteObjectHelper::GetEmbeddedName (rDataHelper, sName, sSource, nFormat)) if (SvPasteObjectHelper::GetEmbeddedName (rDataHelper, sName, sSource, nFormat))
pResult->AddClipbrdFormat (nFormat, sName); pResult->AddClipbrdFormat (nFormat, sName);
} }
......
...@@ -55,7 +55,7 @@ struct OleObjectDescriptor ...@@ -55,7 +55,7 @@ struct OleObjectDescriptor
/********************** SvObjectServerList ******************************** /********************** SvObjectServerList ********************************
**************************************************************************/ **************************************************************************/
const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) const const SvObjectServer * SvObjectServerList::Get( const OUString & rHumanName ) const
{ {
for( size_t i = 0; i < aObjectServerList.size(); i++ ) for( size_t i = 0; i < aObjectServerList.size(); i++ )
{ {
...@@ -189,7 +189,7 @@ void SvObjectServerList::FillInsertObjects() ...@@ -189,7 +189,7 @@ void SvObjectServerList::FillInsertObjects()
} }
} }
String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) OUString SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
{ {
struct SotResourcePair struct SotResourcePair
{ {
...@@ -284,7 +284,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) ...@@ -284,7 +284,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
return aUIName; return aUIName;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rData,String& _rName,String& _rSource,SotFormatStringId& _nFormat) sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rData, OUString& _rName, OUString& _rSource, SotFormatStringId& _nFormat)
{ {
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
if( _nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE || _nFormat == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) if( _nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE || _nFormat == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE )
...@@ -314,7 +314,7 @@ sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rDat ...@@ -314,7 +314,7 @@ sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rDat
reinterpret_cast< sal_Char* >( pOleObjDescr ) + reinterpret_cast< sal_Char* >( pOleObjDescr ) +
pOleObjDescr->dwFullUserTypeName ); pOleObjDescr->dwFullUserTypeName );
_rName.Append( pUserTypeName ); _rName += pUserTypeName;
// the following statement was here for historical reasons, it is commented out since it causes bug i49460 // the following statement was here for historical reasons, it is commented out since it causes bug i49460
// _nFormat = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE; // _nFormat = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE;
} }
...@@ -331,7 +331,7 @@ sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rDat ...@@ -331,7 +331,7 @@ sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rDat
reinterpret_cast< sal_Char* >( pOleObjDescr ) + reinterpret_cast< sal_Char* >( pOleObjDescr ) +
pOleObjDescr->dwSrcOfCopy ); pOleObjDescr->dwSrcOfCopy );
_rSource.Append( pSrcOfCopy ); _rSource += pSrcOfCopy;
} }
else else
_rSource = SVT_RESSTR(STR_UNKNOWN_SOURCE); _rSource = SVT_RESSTR(STR_UNKNOWN_SOURCE);
......
...@@ -2921,7 +2921,7 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh, ...@@ -2921,7 +2921,7 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh,
SotFormatStringId nFormat; SotFormatStringId nFormat;
if ( rData.HasFormat(nFormat = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE) || rData.HasFormat(nFormat = SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE) ) if ( rData.HasFormat(nFormat = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE) || rData.HasFormat(nFormat = SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE) )
{ {
String sName,sSource; OUString sName,sSource;
if ( SvPasteObjectHelper::GetEmbeddedName(rData,sName,sSource,nFormat) ) if ( SvPasteObjectHelper::GetEmbeddedName(rData,sName,sSource,nFormat) )
rToFill.AddClipbrdFormat( nFormat, sName ); rToFill.AddClipbrdFormat( nFormat, sName );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment