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