Kaydet (Commit) 60d7c4b9 authored tarafından Noel Grandin's avatar Noel Grandin

convert sw/source/ui/inc/l*.hxx from String to OUString

Change-Id: I8566128d3e3271e926a7ff70b453365dfab1f62d
üst dd211963
...@@ -68,7 +68,7 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const ...@@ -68,7 +68,7 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const
rItem.nRows = nRows; rItem.nRows = nRows;
} }
void SwLabDlg::_ReplaceGroup( const String &rMake ) void SwLabDlg::_ReplaceGroup( const OUString &rMake )
{ {
// Remove old entries // Remove old entries
pRecs->erase(pRecs->begin() + 1, pRecs->end()); pRecs->erase(pRecs->begin() + 1, pRecs->end());
...@@ -198,7 +198,7 @@ void SwLabDlg::GetLabItem(SwLabItem &rItem) ...@@ -198,7 +198,7 @@ void SwLabDlg::GetLabItem(SwLabItem &rItem)
} }
} }
SwLabRec* SwLabDlg::GetRecord(const String &rRecName, sal_Bool bCont) SwLabRec* SwLabDlg::GetRecord(const OUString &rRecName, sal_Bool bCont)
{ {
SwLabRec* pRec = NULL; SwLabRec* pRec = NULL;
bool bFound = false; bool bFound = false;
......
...@@ -41,7 +41,7 @@ class SwLabDlg : public SfxTabDialog ...@@ -41,7 +41,7 @@ class SwLabDlg : public SfxTabDialog
std::vector<OUString> aMakes; std::vector<OUString> aMakes;
SwLabRecs* pRecs; SwLabRecs* pRecs;
String aLstGroup; OUString aLstGroup;
OUString m_sBusinessCardDlg; OUString m_sBusinessCardDlg;
bool m_bLabel; bool m_bLabel;
sal_uInt16 m_nFormatId; sal_uInt16 m_nFormatId;
...@@ -50,7 +50,7 @@ class SwLabDlg : public SfxTabDialog ...@@ -50,7 +50,7 @@ class SwLabDlg : public SfxTabDialog
sal_uInt16 m_nCardsId; sal_uInt16 m_nCardsId;
sal_uInt16 m_nBusinessId; sal_uInt16 m_nBusinessId;
sal_uInt16 m_nPrivateId; sal_uInt16 m_nPrivateId;
void _ReplaceGroup( const String &rMake ); void _ReplaceGroup( const OUString &rMake );
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
public: public:
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel); SwNewDBMgr* pNewDBMgr, sal_Bool bLabel);
~SwLabDlg(); ~SwLabDlg();
SwLabRec* GetRecord(const String &rRecName, sal_Bool bCont); SwLabRec* GetRecord(const OUString &rRecName, sal_Bool bCont);
void GetLabItem(SwLabItem &rItem); void GetLabItem(SwLabItem &rItem);
SwLabRecs &Recs() { return *pRecs; } SwLabRecs &Recs() { return *pRecs; }
...@@ -72,8 +72,8 @@ public: ...@@ -72,8 +72,8 @@ public:
const std::vector<OUString> &Makes() const { return aMakes; } const std::vector<OUString> &Makes() const { return aMakes; }
Printer *GetPrt(); Printer *GetPrt();
inline void ReplaceGroup( const String &rMake ); inline void ReplaceGroup( const OUString &rMake );
void UpdateGroup( const String &rMake ) {_ReplaceGroup( rMake );} void UpdateGroup( const OUString &rMake ) {_ReplaceGroup( rMake );}
static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel, static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
const SwLabItem& rItem); const SwLabItem& rItem);
const OUString& GetBusinessCardStr() const {return m_sBusinessCardDlg;} const OUString& GetBusinessCardStr() const {return m_sBusinessCardDlg;}
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
}; };
inline void SwLabDlg::ReplaceGroup( const String &rMake ) inline void SwLabDlg::ReplaceGroup( const OUString &rMake )
{ {
if ( rMake != aLstGroup ) if ( rMake != aLstGroup )
_ReplaceGroup( rMake ); _ReplaceGroup( rMake );
......
...@@ -32,9 +32,9 @@ namespace SwLangHelper ...@@ -32,9 +32,9 @@ namespace SwLangHelper
extern sal_uInt16 GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet ); extern sal_uInt16 GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView &rView, SwWrtShell &rSh ); extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView &rView, SwWrtShell &rSh );
extern void SetLanguage( SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ); extern void SetLanguage( SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
// extern void SetLanguage( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ); // extern void SetLanguage( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ); extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
extern void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet ); extern void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet );
// extern void SetLanguage_None( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet ); // extern void SetLanguage_None( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
extern void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet ); extern void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
...@@ -47,8 +47,8 @@ namespace SwLangHelper ...@@ -47,8 +47,8 @@ namespace SwLangHelper
// EditView // EditView
extern void SelectPara( EditView &rEditView, const ESelection &rCurSel ); extern void SelectPara( EditView &rEditView, const ESelection &rCurSel );
extern String GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection ); extern OUString GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection );
extern String GetTextForLanguageGuessing( SwWrtShell &rSh ); extern OUString GetTextForLanguageGuessing( SwWrtShell &rSh );
extern LanguageType GetLanguage( SfxItemSet aSet, sal_uInt16 nLangWhichId ); extern LanguageType GetLanguage( SfxItemSet aSet, sal_uInt16 nLangWhichId );
extern LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId ); extern LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId );
......
...@@ -230,12 +230,12 @@ namespace SwLangHelper ...@@ -230,12 +230,12 @@ namespace SwLangHelper
} }
void SetLanguage( SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ) void SetLanguage( SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
{ {
SetLanguage( rWrtSh, 0 , ESelection(), rLangText, bIsForSelection, rCoreSet ); SetLanguage( rWrtSh, 0 , ESelection(), rLangText, bIsForSelection, rCoreSet );
} }
void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ) void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
{ {
const LanguageType nLang = SvtLanguageTable().GetType( rLangText ); const LanguageType nLang = SvtLanguageTable().GetType( rLangText );
if (nLang != LANGUAGE_DONTKNOW) if (nLang != LANGUAGE_DONTKNOW)
...@@ -546,44 +546,44 @@ namespace SwLangHelper ...@@ -546,44 +546,44 @@ namespace SwLangHelper
return nCurrentLang; return nCurrentLang;
} }
String GetTextForLanguageGuessing( SwWrtShell &rSh ) OUString GetTextForLanguageGuessing( SwWrtShell &rSh )
{ {
// string for guessing language // string for guessing language
String aText; OUString aText;
SwPaM *pCrsr = rSh.GetCrsr(); SwPaM *pCrsr = rSh.GetCrsr();
SwTxtNode *pNode = pCrsr->GetNode()->GetTxtNode(); SwTxtNode *pNode = pCrsr->GetNode()->GetTxtNode();
if (pNode) if (pNode)
{ {
aText = pNode->GetTxt(); aText = pNode->GetTxt();
if (aText.Len() > 0) if (!aText.isEmpty())
{ {
xub_StrLen nStt = 0; xub_StrLen nStt = 0;
xub_StrLen nEnd = pCrsr->GetPoint()->nContent.GetIndex(); xub_StrLen nEnd = pCrsr->GetPoint()->nContent.GetIndex();
// at most 100 chars to the left... // at most 100 chars to the left...
nStt = nEnd > 100 ? nEnd - 100 : 0; nStt = nEnd > 100 ? nEnd - 100 : 0;
// ... and 100 to the right of the cursor position // ... and 100 to the right of the cursor position
nEnd = aText.Len() - nEnd > 100 ? nEnd + 100 : aText.Len(); nEnd = aText.getLength() - nEnd > 100 ? nEnd + 100 : aText.getLength();
aText = aText.Copy( nStt, nEnd - nStt ); aText = aText.copy( nStt, nEnd - nStt );
} }
} }
return aText; return aText;
} }
String GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection ) OUString GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection )
{ {
// string for guessing language // string for guessing language
String aText; OUString aText;
aText = rEditEngine->GetText(aDocSelection); aText = rEditEngine->GetText(aDocSelection);
if (aText.Len() > 0) if (!aText.isEmpty())
{ {
xub_StrLen nStt = 0; xub_StrLen nStt = 0;
xub_StrLen nEnd = aDocSelection.nEndPos; xub_StrLen nEnd = aDocSelection.nEndPos;
// at most 100 chars to the left... // at most 100 chars to the left...
nStt = nEnd > 100 ? nEnd - 100 : 0; nStt = nEnd > 100 ? nEnd - 100 : 0;
// ... and 100 to the right of the cursor position // ... and 100 to the right of the cursor position
nEnd = aText.Len() - nEnd > 100 ? nEnd + 100 : aText.Len(); nEnd = aText.getLength() - nEnd > 100 ? nEnd + 100 : aText.getLength();
aText = aText.Copy( nStt, nEnd - nStt ); aText = aText.copy( nStt, nEnd - nStt );
} }
return aText; return aText;
......
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