Kaydet (Commit) 3b748229 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Caolán McNamara

String to OUString

Change-Id: I775327d5218655841006bcac5a1dbf236503fbb5
Reviewed-on: https://gerrit.libreoffice.org/6025Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8a183e1a
...@@ -47,8 +47,8 @@ using namespace ::std; ...@@ -47,8 +47,8 @@ using namespace ::std;
struct CompatibilityItem struct CompatibilityItem
{ {
String m_sName; OUString m_sName;
String m_sModule; OUString m_sModule;
bool m_bUsePrtMetrics; bool m_bUsePrtMetrics;
bool m_bAddSpacing; bool m_bAddSpacing;
bool m_bAddSpacingAtPages; bool m_bAddSpacingAtPages;
...@@ -63,7 +63,7 @@ struct CompatibilityItem ...@@ -63,7 +63,7 @@ struct CompatibilityItem
bool m_bIsDefault; bool m_bIsDefault;
bool m_bIsUser; bool m_bIsUser;
CompatibilityItem( const String& _rName, const String& _rModule, CompatibilityItem( const OUString& _rName, const OUString& _rModule,
bool _bUsePrtMetrics, bool _bAddSpacing, bool _bAddSpacingAtPages, bool _bUsePrtMetrics, bool _bAddSpacing, bool _bAddSpacingAtPages,
bool _bUseOurTabStops, bool _bNoExtLeading, bool _bUseLineSpacing, bool _bUseOurTabStops, bool _bNoExtLeading, bool _bUseLineSpacing,
bool _bAddTableSpacing, bool _bUseObjPos, bool _bUseOurTextWrapping, bool _bAddTableSpacing, bool _bUseObjPos, bool _bUseOurTextWrapping,
...@@ -112,7 +112,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(Window* pParent, const SfxItemSet ...@@ -112,7 +112,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(Window* pParent, const SfxItemSet
for (sal_uInt16 nId = COPT_USE_PRINTERDEVICE; nId <= COPT_EXPAND_WORDSPACE; ++nId) for (sal_uInt16 nId = COPT_USE_PRINTERDEVICE; nId <= COPT_EXPAND_WORDSPACE; ++nId)
{ {
String sEntry = m_pFormattingLB->GetEntry(nId); OUString sEntry = m_pFormattingLB->GetEntry(nId);
if ( COPT_USE_OUR_TABSTOPS == nId || if ( COPT_USE_OUR_TABSTOPS == nId ||
COPT_USE_LINESPACING == nId || COPT_USE_LINESPACING == nId ||
COPT_USE_OBJECTPOSITIONING == nId || COPT_USE_OBJECTPOSITIONING == nId ||
...@@ -143,20 +143,18 @@ SwCompatibilityOptPage::~SwCompatibilityOptPage() ...@@ -143,20 +143,18 @@ SwCompatibilityOptPage::~SwCompatibilityOptPage()
delete m_pImpl; delete m_pImpl;
} }
void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry ) void SwCompatibilityOptPage::ReplaceFormatName( OUString& rEntry )
{ {
OUString sFormatName(utl::ConfigManager::getProductName()); OUString sFormatName(utl::ConfigManager::getProductName());
OUString sFormatVersion; const bool bOpenOffice = ( sFormatName == "OpenOffice.org" );
bool bOpenOffice = ( sFormatName == "OpenOffice.org" ); const OUString sFormatVersion = bOpenOffice
if ( bOpenOffice ) ? OUString("1.1")
sFormatVersion = OUString("1.1"); : OUString("6.0/7");
else
sFormatVersion = OUString("6.0/7");
if ( !bOpenOffice && ( sFormatName != "StarSuite" ) ) if ( !bOpenOffice && ( sFormatName != "StarSuite" ) )
sFormatName = OUString("StarOffice"); sFormatName = "StarOffice";
rEntry.SearchAndReplace( OUString("%FORMATNAME"), sFormatName ); rEntry = rEntry.replaceFirst( "%FORMATNAME", sFormatName )
rEntry.SearchAndReplace( OUString("%FORMATVERSION"), sFormatVersion ); .replaceFirst( "%FORMATVERSION", sFormatVersion );
} }
sal_uLong convertBools2Ulong_Impl sal_uLong convertBools2Ulong_Impl
...@@ -216,7 +214,7 @@ sal_uLong convertBools2Ulong_Impl ...@@ -216,7 +214,7 @@ sal_uLong convertBools2Ulong_Impl
void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
{ {
// init objectshell and detect document name // init objectshell and detect document name
String sDocTitle; OUString sDocTitle;
const SfxPoolItem* pItem = NULL; const SfxPoolItem* pItem = NULL;
SfxObjectShell* pObjShell = NULL; SfxObjectShell* pObjShell = NULL;
if ( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_WRTSHELL, sal_False, &pItem ) ) if ( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_WRTSHELL, sal_False, &pItem ) )
...@@ -252,7 +250,6 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) ...@@ -252,7 +250,6 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
int i, j, nCount = aList.getLength(); int i, j, nCount = aList.getLength();
for ( i = 0; i < nCount; ++i ) for ( i = 0; i < nCount; ++i )
{ {
String sNewEntry;
const Sequence< PropertyValue >& rEntry = aList[i]; const Sequence< PropertyValue >& rEntry = aList[i];
for ( j = 0; j < rEntry.getLength(); j++ ) for ( j = 0; j < rEntry.getLength(); j++ )
{ {
...@@ -297,6 +294,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) ...@@ -297,6 +294,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
if ( aItem.m_bIsDefault ) if ( aItem.m_bIsDefault )
continue; continue;
OUString sNewEntry;
if ( sName.equals( USER_ENTRY ) ) if ( sName.equals( USER_ENTRY ) )
sNewEntry = m_sUserEntry; sNewEntry = m_sUserEntry;
else if ( pObjShell && !sName.isEmpty() ) else if ( pObjShell && !sName.isEmpty() )
...@@ -307,7 +305,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) ...@@ -307,7 +305,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
sNewEntry = pFilter->GetUIName(); sNewEntry = pFilter->GetUIName();
} }
if ( sNewEntry.Len() == 0 ) if ( sNewEntry.isEmpty() )
sNewEntry = sName; sNewEntry = sName;
sal_uInt16 nPos = m_pFormattingLB->InsertEntry( sNewEntry ); sal_uInt16 nPos = m_pFormattingLB->InsertEntry( sNewEntry );
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <unotools/compatibility.hxx> #include <unotools/compatibility.hxx>
#include <svx/checklbx.hxx> #include <svx/checklbx.hxx>
#include "rtl/ustring.hxx"
// class SwCompatibilityOptPage ------------------------------------------ // class SwCompatibilityOptPage ------------------------------------------
class SwWrtShell; class SwWrtShell;
...@@ -41,7 +42,7 @@ private: ...@@ -41,7 +42,7 @@ private:
// config item // config item
SvtCompatibilityOptions m_aConfigItem; SvtCompatibilityOptions m_aConfigItem;
// text of the user entry // text of the user entry
String m_sUserEntry; OUString m_sUserEntry;
// shell of the current document // shell of the current document
SwWrtShell* m_pWrtShell; SwWrtShell* m_pWrtShell;
// impl object // impl object
...@@ -55,7 +56,7 @@ private: ...@@ -55,7 +56,7 @@ private:
// private methods // private methods
void InitControls( const SfxItemSet& rSet ); void InitControls( const SfxItemSet& rSet );
void ReplaceFormatName( String& rEntry ); void ReplaceFormatName( OUString& rEntry );
void SetCurrentOptions( sal_uLong nOptions ); void SetCurrentOptions( sal_uLong nOptions );
sal_uLong GetDocumentOptions() const; sal_uLong GetDocumentOptions() const;
void WriteOptions(); void WriteOptions();
......
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