diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2013-01-21 14:32:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-21 20:48:35 +0000 |
commit | e3f11c10d8cc759d01afa4b8fd8bd98c81a03119 (patch) | |
tree | 36191c6d90da559009161a1199d1176cf6a2bbba /sw | |
parent | Fix Variable 'nMode' is reassigned (diff) | |
download | core-e3f11c10d8cc759d01afa4b8fd8bd98c81a03119.tar.gz core-e3f11c10d8cc759d01afa4b8fd8bd98c81a03119.zip |
Changed SetText() / GetText() to take/return OUString
replaced lots of Len() with isEmpty()
Change-Id: I6b82d48245ee2a0782e05a326f7934e9357227d0
Reviewed-on: https://gerrit.libreoffice.org/1795
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
39 files changed, 158 insertions, 159 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index f2cc3383023c..393cb5cffda1 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -116,7 +116,7 @@ public: virtual String GetStr() = 0; //from class Window virtual void SetHelpId( const rtl::OString& sHelpId ) = 0; - virtual void SetText( const XubString& rStr ) = 0; + virtual void SetText( const OUString& rStr ) = 0; }; class AbstractInsertGrfRulerDlg : public VclAbstractDialog //add for SwInsertGrfRulerDlg @@ -138,7 +138,7 @@ public: class AbstractJavaEditDialog : public VclAbstractDialog //add for SwJavaEditDialog { public: - virtual String GetText() = 0; + virtual OUString GetText() = 0; virtual String GetType() = 0; virtual sal_Bool IsUrl() = 0; virtual sal_Bool IsNew() = 0; diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx index d4a8d0eeb7bf..43bae1046cb1 100644 --- a/sw/source/ui/cctrl/actctrl.cxx +++ b/sw/source/ui/cctrl/actctrl.cxx @@ -82,12 +82,12 @@ void NoSpaceEdit::KeyInput(const KeyEvent& rEvt) void NoSpaceEdit::Modify() { Selection aSel = GetSelection(); - String sTemp = GetText(); + OUString sTemp = GetText(); for(sal_uInt16 i = 0; i < sForbiddenChars.Len(); i++) { sTemp = comphelper::string::remove(sTemp, sForbiddenChars.GetChar(i)); } - sal_uInt16 nDiff = GetText().Len() - sTemp.Len(); + sal_Int32 nDiff = GetText().getLength() - sTemp.getLength(); if(nDiff) { aSel.setMin(aSel.getMin() - nDiff); diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx index 6e6a85b6fea3..c3694efcfaa3 100644 --- a/sw/source/ui/cctrl/swlbox.cxx +++ b/sw/source/ui/cctrl/swlbox.cxx @@ -157,9 +157,9 @@ void SwComboBox::KeyInput( const KeyEvent& rKEvt ) } // Convert text according to option -String SwComboBox::GetText() const +OUString SwComboBox::GetText() const { - String aTxt( ComboBox::GetText() ); + OUString aTxt( ComboBox::GetText() ); if(nStyle & CBS_LOWER) aTxt = GetAppCharClass().lowercase( aTxt ); diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index e7efa9177250..7b450d9bc4ec 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -248,9 +248,9 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) SwFmtINetFmt aINetFmt(sURL, m_pTargetFrmLB->GetText()); aINetFmt.SetName(m_pNameED->GetText()); - bModified |= m_pURLED->GetText() != m_pURLED->GetSavedValue(); + bModified |= m_pURLED->GetText() != OUString(m_pURLED->GetSavedValue()); bModified |= m_pNameED->IsModified(); - bModified |= m_pTargetFrmLB->GetSavedValue() != m_pTargetFrmLB->GetText(); + bModified |= OUString(m_pTargetFrmLB->GetSavedValue()) != m_pTargetFrmLB->GetText(); // set valid settings first String sEntry = m_pVisitedLB->GetSelectEntry(); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 5672ac4cfe0b..9e5e493b335f 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -119,7 +119,7 @@ public: void UpdatePaintSettings( void ); // also invalidates control! - inline void SetText( const String& rT ); + inline void SetText( const OUString& rT ); inline void SetLines( sal_uInt8 nL ); inline void SetDistance( sal_uInt16 nD ); inline void SetValues( const String& rText, sal_uInt8 nLines, sal_uInt16 nDistance ); @@ -127,7 +127,7 @@ public: void DrawPrev( const Point& rPt ); }; -inline void SwDropCapsPict::SetText( const String& rT ) +inline void SwDropCapsPict::SetText( const OUString& rT ) { maText = rT; UpdatePaintSettings(); @@ -744,10 +744,10 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) } else if (pEdit == &aTextEdit) // set quantity if applicable { - sal_uInt16 nTmp = aTextEdit.GetText().Len(); - aDropCapsField.SetValue(Max((sal_uInt16)1, nTmp)); + sal_Int32 nTmp = aTextEdit.GetText().getLength(); + aDropCapsField.SetValue(Max((sal_uInt16)1, (sal_uInt16)nTmp)); - sPreview = aTextEdit.GetText().Copy(0, nTmp); + sPreview = aTextEdit.GetText().copy(0, nTmp); } // adjust image diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 4482edd3e235..671b1956605b 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -134,7 +134,7 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) } if(aNewStartCB.GetState() != aNewStartCB.GetSavedValue() || aNewStartNumberCB.GetState() != aNewStartNumberCB.GetSavedValue()|| - aNewStartNF.GetText() != aNewStartNF.GetSavedValue()) + aNewStartNF.GetText() != OUString(aNewStartNF.GetSavedValue())) { bModified = sal_True; sal_Bool bNewStartChecked = STATE_CHECK == aNewStartCB.GetState(); @@ -146,7 +146,7 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) if(aCountParaCB.GetSavedValue() != aCountParaCB.GetState() || aRestartParaCountCB.GetSavedValue() != aRestartParaCountCB.GetState() || - aRestartNF.GetSavedValue() != aRestartNF.GetText() ) + OUString(aRestartNF.GetSavedValue()) != aRestartNF.GetText() ) { SwFmtLineNumber aFmt; aFmt.SetStartValue( static_cast< sal_uLong >(aRestartParaCountCB.GetState() == STATE_CHECK ? diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 8dc428e6c0d7..5dc1a29443bf 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -170,15 +170,15 @@ SfxTabPage* SwMailConfigPage::Create( Window* pParent, const SfxItemSet& rAttrS sal_Bool SwMailConfigPage::FillItemSet( SfxItemSet& /*rSet*/ ) { - if(m_aDisplayNameED.GetText() != m_aDisplayNameED.GetSavedValue()) + if(m_aDisplayNameED.GetText() != OUString(m_aDisplayNameED.GetSavedValue())) m_pConfigItem->SetMailDisplayName(m_aDisplayNameED.GetText()); - if(m_aAddressED.GetText() != m_aAddressED.GetSavedValue()) + if(m_aAddressED.GetText() != OUString(m_aAddressED.GetSavedValue())) m_pConfigItem->SetMailAddress(m_aAddressED.GetText()); if( m_aReplyToCB.GetSavedValue() != m_aReplyToCB.IsChecked()) m_pConfigItem->SetMailReplyTo(m_aReplyToCB.IsChecked()); - if(m_aReplyToED.GetText() != m_aReplyToED.GetSavedValue()) + if(m_aReplyToED.GetText() != OUString(m_aReplyToED.GetSavedValue())) m_pConfigItem->SetMailReplyTo(m_aReplyToED.GetText()); - if(m_aServerED.GetText() != m_aServerED.GetSavedValue()) + if(m_aServerED.GetText() != OUString(m_aServerED.GetSavedValue())) m_pConfigItem->SetMailServer(m_aServerED.GetText()); if(m_aPortNF.IsModified()) diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index fbdd800a5caa..6c4d0b721de3 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -189,7 +189,7 @@ sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) bRet = sal_True; } - if(aTabMF.IsVisible() && aTabMF.GetText() != aTabMF.GetSavedValue()) + if(aTabMF.IsVisible() && aTabMF.GetText() != OUString(aTabMF.GetSavedValue())) { rSet.Put(SfxUInt16Item(SID_ATTR_DEFTABSTOP, (sal_uInt16)aTabMF.Denormalize(aTabMF.GetValue(FUNIT_TWIP)))); @@ -205,7 +205,7 @@ sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) bRet = sal_True; } - if (aWordCountED.GetText() != aWordCountED.GetSavedValue()) + if (aWordCountED.GetText() != OUString(aWordCountED.GetSavedValue())) { boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create()); @@ -691,7 +691,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) if (pOpt->GetCategory().Len() && aCategoryBox.GetEntryPos(pOpt->GetCategory()) == COMBOBOX_ENTRY_NOTFOUND) aCategoryBox.InsertEntry(pOpt->GetCategory()); - if (!aCategoryBox.GetText().Len()) + if (aCategoryBox.GetText().isEmpty()) { sal_uInt16 nPos = 0; switch(pOpt->GetObjType()) @@ -775,7 +775,7 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) else pOpt->SetCategory(comphelper::string::strip(aName, ' ')); pOpt->SetNumType((sal_uInt16)(sal_uLong)aFormatBox.GetEntryData(aFormatBox.GetSelectEntryPos())); - pOpt->SetCaption(aTextEdit.IsEnabled() ? aTextEdit.GetText() : aEmptyStr ); + pOpt->SetCaption(aTextEdit.IsEnabled() ? aTextEdit.GetText() : OUString(aEmptyStr) ); pOpt->SetPos(aPosBox.GetSelectEntryPos()); sal_uInt16 nPos = aLbLevel.GetSelectEntryPos(); sal_uInt16 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; @@ -837,7 +837,7 @@ void SwCaptionOptPage::DrawSample() { String aStr; - if( aCategoryBox.GetText() != sNone) + if( aCategoryBox.GetText() != OUString(sNone)) { //#i61007# order of captions bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index d28bd4d0c132..8cd9f2406d63 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -631,11 +631,11 @@ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& ) String sLabel = aLabelBox .GetText(); String sIdx = aIdxBox .GetText(); - bool bStandardHeightChanged = aStandardHeightLB.GetSavedValue() != aStandardHeightLB.GetText(); - bool bTitleHeightChanged = aTitleHeightLB.GetSavedValue() != aTitleHeightLB.GetText(); - bool bListHeightChanged = aListHeightLB.GetSavedValue() != aListHeightLB.GetText() && (!bListHeightDefault || !bSetListHeightDefault ); - bool bLabelHeightChanged = aLabelHeightLB.GetSavedValue() != aLabelHeightLB.GetText() && (!bLabelHeightDefault || !bSetLabelHeightDefault ); - bool bIndexHeightChanged = aIndexHeightLB.GetSavedValue() != aIndexHeightLB.GetText() && (!bIndexHeightDefault || !bSetIndexHeightDefault ); + bool bStandardHeightChanged = OUString(aStandardHeightLB.GetSavedValue()) != aStandardHeightLB.GetText(); + bool bTitleHeightChanged = OUString(aTitleHeightLB.GetSavedValue()) != aTitleHeightLB.GetText(); + bool bListHeightChanged = OUString(aListHeightLB.GetSavedValue()) != aListHeightLB.GetText() && (!bListHeightDefault || !bSetListHeightDefault ); + bool bLabelHeightChanged = OUString(aLabelHeightLB.GetSavedValue()) != aLabelHeightLB.GetText() && (!bLabelHeightDefault || !bSetLabelHeightDefault ); + bool bIndexHeightChanged = OUString(aIndexHeightLB.GetSavedValue()) != aIndexHeightLB.GetText() && (!bIndexHeightDefault || !bSetIndexHeightDefault ); if(bNotDocOnly) { pFontConfig->SetFontStandard(sStandard, nFontGroup); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index b622a1fb1727..f7f853273e8d 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -744,7 +744,7 @@ IMPL_LINK_NOARG(SwFindEntryDialog, FindHdl_Impl) IMPL_LINK_NOARG(SwFindEntryDialog, FindEnableHdl_Impl) { - m_aFindPB.Enable(m_aFindED.GetText().Len() > 0); + m_aFindPB.Enable(!m_aFindED.GetText().isEmpty()); return 0; } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 507248932ff1..bd2134f6d6de 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -242,7 +242,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, { FreeResource(); - nGBFmtLen = aFlFormat.GetText().Len(); + nGBFmtLen = aFlFormat.GetText().getLength(); if(xColSupp.is()) { @@ -799,7 +799,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) { // set the selected FieldName at the FormatGroupBox, so that // it's clear what field is configured by the format! - String sTxt( aFlFormat.GetText().Copy( 0, nGBFmtLen )); + String sTxt( aFlFormat.GetText().copy( 0, nGBFmtLen )); if( aSrch.sColumn.isEmpty() ) { aRbDbFmtFromDb.Enable( sal_False ); diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 1d2e4ce2abfe..d91418613636 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -518,12 +518,12 @@ void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt) void SwRestrictedComboBox::Modify() { Selection aSel = GetSelection(); - String sTemp = GetText(); + OUString sTemp = GetText(); for(sal_uInt16 i = 0; i < sForbiddenChars.Len(); i++) { sTemp = comphelper::string::remove(sTemp, sForbiddenChars.GetChar(i)); } - sal_uInt16 nDiff = GetText().Len() - sTemp.Len(); + sal_Int32 nDiff = GetText().getLength() - sTemp.getLength(); if(nDiff) { aSel.setMin(aSel.getMin() - nDiff); @@ -822,7 +822,7 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() m_aRemoveFieldIB.Enable(m_aDragED.HasCurrentItem() ? sal_True : sal_False); SvTreeListEntry* pEntry = m_aAddressElementsLB.GetCurEntry(); m_aInsertFieldIB.Enable( pEntry && - (0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || m_aFieldCB.GetText().Len())); + (0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || !m_aFieldCB.GetText().isEmpty())); } void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress) @@ -1427,7 +1427,7 @@ long AddressMultiLineEdit::PreNotify( NotifyEvent& rNEvt ) } -void AddressMultiLineEdit::SetText( const String& rStr ) +void AddressMultiLineEdit::SetText( const OUString& rStr ) { MultiLineEdit::SetText(rStr); //set attributes to all address tokens diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index bd7ab5d3b474..9c2d76be843b 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -173,7 +173,7 @@ public: void SetSelectionChangedHdl( const Link& rLink ) {m_aSelectionLink = rLink;} - void SetText( const String& rStr ); + void SetText( const OUString& rStr ); String GetAddress(); void InsertNewEntry( const String& rStr ); diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 96244f415fba..5cbaa819da84 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -201,8 +201,8 @@ void SwMailMergeGreetingsPage::UpdatePreview() } } - String sPreview = bFemale ? m_aFemaleLB.GetSelectEntry() : - bNoValue ? m_aNeutralCB.GetText() : m_aMaleLB.GetSelectEntry(); + String sPreview = bFemale ? OUString(m_aFemaleLB.GetSelectEntry()) : + bNoValue ? m_aNeutralCB.GetText() : OUString(m_aMaleLB.GetSelectEntry()); sPreview = SwAddressPreview::FillData(sPreview, m_pWizard->GetConfigItem()); m_aPreviewWIN.SetAddress(sPreview); @@ -367,7 +367,7 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPage aAssignment[MM_PART_GENDER] = m_aFemaleColumnLB.GetSelectEntry(); rConfig.SetColumnAssignment( rDBData, aAssignment ); } - if(m_aFemaleFieldCB.GetText() != m_aFemaleFieldCB.GetSavedValue()) + if(m_aFemaleFieldCB.GetText() != OUString(m_aFemaleFieldCB.GetSavedValue())) rConfig.SetFemaleGenderValue(m_aFemaleFieldCB.GetText()); lcl_StoreGreetingsBox(m_aFemaleLB, rConfig, SwMailMergeConfigItem::FEMALE); @@ -561,7 +561,7 @@ IMPL_LINK_NOARG(SwMailBodyDialog, OKHdl) aAssignment[MM_PART_GENDER] = ::rtl::OUString(); rConfigItem.SetColumnAssignment( rDBData, aAssignment ); } - if(m_aFemaleFieldCB.GetText() != m_aFemaleFieldCB.GetSavedValue()) + if(m_aFemaleFieldCB.GetText() != OUString(m_aFemaleFieldCB.GetSavedValue())) rConfigItem.SetFemaleGenderValue(m_aFemaleFieldCB.GetText()); EndDialog(RET_OK); diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 10b0024b8e35..20705bd5f469 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -179,7 +179,7 @@ SwSaveWarningBox_Impl::~SwSaveWarningBox_Impl() IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit*, pEdit) { - aOKPB.Enable(pEdit->GetText().Len() > 0); + aOKPB.Enable(!pEdit->GetText().isEmpty()); return 0; } @@ -206,7 +206,7 @@ SwSendQueryBox_Impl::~SwSendQueryBox_Impl() IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit) { - aOKPB.Enable(bIsEmptyAllowed || (pEdit->GetText().Len() > 0)); + aOKPB.Enable(bIsEmptyAllowed || !pEdit->GetText().isEmpty()); return 0; } @@ -528,7 +528,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton) if(!m_aFromRB.IsChecked()) m_aSendAllRB.Check(); - if(!m_aAttachmentED.GetText().Len()) + if(m_aAttachmentED.GetText().isEmpty()) { String sAttach( m_sDefaultAttachmentST ); sAttach += '.'; @@ -626,7 +626,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton) { INetURLObject aURL = pDocShell->GetMedium()->GetURLObject(); //update the attachment name - if(!m_aAttachmentED.GetText().Len()) + if(m_aAttachmentED.GetText().isEmpty()) { if ( pDocShell->HasName() ) { @@ -1098,7 +1098,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) return 0; ::rtl::OUString sMimeType = pSfxFlt->GetMimeType(); - if(!m_aSubjectED.GetText().Len()) + if(m_aSubjectED.GetText().isEmpty()) { SwSendQueryBox_Impl aQuery(pButton, m_sNoSubjectQueryST); aQuery.SetIsEmptyTextAllowed(true); @@ -1111,7 +1111,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) else return 0; } - if(!bAsBody && !m_aAttachmentED.GetText().Len()) + if(!bAsBody && m_aAttachmentED.GetText().isEmpty()) { SwSendQueryBox_Impl aQuery(pButton, m_sNoAttachmentNameST); aQuery.SetIsEmptyTextAllowed(false); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 51539977a258..b84e88b90a59 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -152,12 +152,12 @@ void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) } //From class Window. -void AbstractTabDialog_Impl::SetText( const XubString& rStr ) +void AbstractTabDialog_Impl::SetText( const OUString& rStr ) { pDlg->SetText( rStr ); } -String AbstractTabDialog_Impl::GetText() const +OUString AbstractTabDialog_Impl::GetText() const { return pDlg->GetText(); } @@ -190,12 +190,12 @@ const SfxItemSet* SwAbstractSfxDialog_Impl::GetOutputItemSet() const return pDlg->GetOutputItemSet(); } -void SwAbstractSfxDialog_Impl::SetText( const XubString& rStr ) +void SwAbstractSfxDialog_Impl::SetText( const OUString& rStr ) { pDlg->SetText( rStr ); } -String SwAbstractSfxDialog_Impl::GetText() const +OUString SwAbstractSfxDialog_Impl::GetText() const { return pDlg->GetText(); } @@ -274,12 +274,12 @@ void AbstractSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) pDlg->SetInputSet( pInSet ); } -void AbstractSwLabDlg_Impl::SetText( const XubString& rStr ) +void AbstractSwLabDlg_Impl::SetText( const OUString& rStr ) { pDlg->SetText( rStr ); } -String AbstractSwLabDlg_Impl::GetText() const +OUString AbstractSwLabDlg_Impl::GetText() const { return pDlg->GetText(); } @@ -339,12 +339,12 @@ void AbstractSwFldDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) pDlg->SetInputSet( pInSet ); } -void AbstractSwFldDlg_Impl::SetText( const XubString& rStr ) +void AbstractSwFldDlg_Impl::SetText( const OUString& rStr ) { pDlg->SetText( rStr ); } -String AbstractSwFldDlg_Impl::GetText() const +OUString AbstractSwFldDlg_Impl::GetText() const { return pDlg->GetText(); } @@ -433,7 +433,7 @@ void AbstractInsFootNoteDlg_Impl::SetHelpId( const rtl::OString& sHelpId ) pDlg->SetHelpId( sHelpId ); } -void AbstractInsFootNoteDlg_Impl::SetText( const XubString& rStr ) +void AbstractInsFootNoteDlg_Impl::SetText( const OUString& rStr ) { pDlg->SetText( rStr ); } @@ -445,7 +445,7 @@ void AbstractInsTableDlg_Impl::GetValues( String& rName, sal_uInt16& rRow, sal_u pDlg->GetValues( rName, rRow, rCol, rInsTblFlags, rTableAutoFmtName, prTAFmt); } -String AbstractJavaEditDialog_Impl::GetText() +OUString AbstractJavaEditDialog_Impl::GetText() { return pDlg->GetText(); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index f50c1395feb0..f4e84fc93c44 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -90,8 +90,8 @@ class SwAbstractSfxDialog_Impl :public SfxAbstractDialog { DECL_ABSTDLG_BASE(SwAbstractSfxDialog_Impl,SfxModalDialog) virtual const SfxItemSet* GetOutputItemSet() const; - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; + virtual void SetText( const OUString& rStr ); + virtual OUString GetText() const; }; // add for SwAddrDlg,SwDropCapsDlg , SwBackgroundDlg SwNumFmtDlg SwWrapDlg SwBorderDlg, SwFldEditDlg end @@ -138,8 +138,8 @@ class AbstractTabDialog_Impl : virtual public SfxAbstractTabDialog virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); virtual void SetInputSet( const SfxItemSet* pInSet ); //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; + virtual void SetText( const OUString& rStr ); + virtual OUString GetText() const; }; //add for SwCharDlg, SwEnvDlg ,SwFootNoteOptionDlg SwParaDlg SwTableTabDlg end @@ -195,8 +195,8 @@ class AbstractSwLabDlg_Impl : public AbstractSwLabDlg virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); virtual void SetInputSet( const SfxItemSet* pInSet ); //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; + virtual void SetText( const OUString& rStr ); + virtual OUString GetText() const; virtual const String& GetBusinessCardStr() const; virtual Printer *GetPrt(); }; @@ -231,8 +231,8 @@ class AbstractSwFldDlg_Impl : public AbstractSwFldDlg //add for SwFldDlg virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); virtual void SetInputSet( const SfxItemSet* pInSet ); //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; + virtual void SetText( const OUString& rStr ); + virtual OUString GetText() const; virtual void Start( sal_Bool bShow = sal_True ); //this method from SfxTabDialog virtual void ShowPage( sal_uInt16 nId );// this method from SfxTabDialog virtual void Initialize(SfxChildWinInfo *pInfo); @@ -291,7 +291,7 @@ class AbstractInsFootNoteDlg_Impl : public AbstractInsFootNoteDlg virtual String GetStr(); //from class Window virtual void SetHelpId( const rtl::OString& sHelpId ); - virtual void SetText( const XubString& rStr ); + virtual void SetText( const OUString& rStr ); }; //for SwInsFootNoteDlg end @@ -311,7 +311,7 @@ class SwJavaEditDialog; class AbstractJavaEditDialog_Impl : public AbstractJavaEditDialog { DECL_ABSTDLG_BASE(AbstractJavaEditDialog_Impl,SwJavaEditDialog) - virtual String GetText(); + virtual OUString GetText(); virtual String GetType(); virtual sal_Bool IsUrl(); virtual sal_Bool IsNew(); diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 8ad2c153b502..4ee633b9e0e4 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -377,15 +377,15 @@ void SwSidebarWin::CheckMetaText() { const SvtSysLocale aSysLocale; const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData(); - String sMeta = GetAuthor(); - if (sMeta.Len() == 0) + OUString sMeta = GetAuthor(); + if (sMeta.isEmpty()) { - sMeta = String(SW_RES(STR_NOAUTHOR)); + sMeta = OUString(SW_RES(STR_NOAUTHOR)); } - else if (sMeta.Len() > 22) + else if (sMeta.getLength() > 22) { - sMeta.Erase(20); - sMeta = sMeta + rtl::OUString("..."); + sMeta.replaceAt(20, sMeta.getLength()-20, ""); + sMeta = sMeta + OUString("..."); } if ( mpMetadataAuthor->GetText() != sMeta ) { @@ -871,7 +871,7 @@ void SwSidebarWin::DeactivatePostIt() if ( !IsProtected() && - Engine()->GetEditEngine().GetText()==String(EMPTYSTRING) ) + Engine()->GetEditEngine().GetText()==OUString(EMPTYSTRING) ) { mnEventId = Application::PostUserEvent( LINK( this, SwSidebarWin, DeleteHdl), 0 ); } @@ -903,7 +903,7 @@ void SwSidebarWin::ExecuteCommand(sal_uInt16 nSlot) { // if this note is empty, it will be deleted once losing the focus, so no reply, but only a new note // will be created - if (Engine()->GetEditEngine().GetText() != String(EMPTYSTRING)) + if (Engine()->GetEditEngine().GetText() != OUString(EMPTYSTRING)) { OutlinerParaObject* pPara = new OutlinerParaObject(*GetOutlinerView()->GetEditView().CreateTextObject()); mrMgr.RegisterAnswer(pPara); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index c4fc2ee52047..ca5f6524aabf 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -275,7 +275,7 @@ IMPL_LINK_NOARG(SwEnvPage, SenderHdl) if ( bEnable ) { aSenderEdit.GrabFocus(); - if(!aSenderEdit.GetText().Len()) + if(aSenderEdit.GetText().isEmpty()) aSenderEdit.SetText(MakeSender()); } aPreview.Invalidate(); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index e4eae417189b..20a66d46dfa8 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -651,7 +651,7 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) IMPL_LINK_NOARG(SwSaveLabelDlg, ModifyHdl) { - aOKPB.Enable(aMakeCB.GetText().Len() && aTypeED.GetText().Len()); + aOKPB.Enable(!aMakeCB.GetText().isEmpty() && !aTypeED.GetText().isEmpty()); return 0; } diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 76771fa71130..4ef4b5e62f77 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -232,8 +232,8 @@ sal_Bool SwFldDBPage::FillItemSet(SfxItemSet& ) sal_Bool bDBListBoxChanged = sOldDBName != sTempDBName || sOldTableName != sTempTableName || sOldColumnName != sTempColumnName; if (!IsFldEdit() || - aConditionED.GetSavedValue() != aConditionED.GetText() || - aValueED.GetSavedValue() != aValueED.GetText() || + OUString(aConditionED.GetSavedValue()) != aConditionED.GetText() || + OUString(aValueED.GetSavedValue()) != aValueED.GetText() || bDBListBoxChanged || nOldFormat != nFormat || nOldSubType != nSubType) { @@ -408,7 +408,7 @@ void SwFldDBPage::CheckInsert() if (nTypeId == TYP_DBNUMSETFLD) { - sal_Bool bHasValue = aValueED.GetText().Len() != 0; + sal_Bool bHasValue = !aValueED.GetText().isEmpty(); bInsert &= bHasValue; } diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index fdb619593c13..79011585cca6 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -522,8 +522,8 @@ IMPL_LINK_NOARG(SwFldDokPage, FormatHdl) // Prev/Next - PageNumFields special treatment: sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)aFormatLB.GetEntryData( aFormatLB.GetSelectEntryPos() ); - String sOldTxt( aValueFT.GetText() ); - String sNewTxt( SW_RES( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE + OUString sOldTxt( aValueFT.GetText() ); + OUString sNewTxt( SW_RES( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE : STR_OFFSET )); if( sOldTxt != sNewTxt ) @@ -600,7 +600,7 @@ sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& ) if( SVX_NUM_CHAR_SPECIAL != nFormat && (TYP_PREVPAGEFLD == nTypeId || TYP_NEXTPAGEFLD == nTypeId)) { - sal_Int32 nVal = aValueED.GetText().ToInt32(); + sal_Int32 nVal = aValueED.GetText().toInt32(); aVal = String::CreateFromInt32(nVal); } break; @@ -618,9 +618,9 @@ sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& ) nOldSel != aSelectionLB.GetSelectEntryPos() || nOldFormat != nFormat || aFixedCB.GetState() != aFixedCB.GetSavedValue() || - aValueED.GetText() != aValueED.GetSavedValue() || - aLevelED.GetText() != aLevelED.GetSavedValue() || - aDateOffsetED.GetText() != aDateOffsetED.GetSavedValue()) + aValueED.GetText() != OUString(aValueED.GetSavedValue()) || + aLevelED.GetText() != OUString(aLevelED.GetSavedValue()) || + aDateOffsetED.GetText() != OUString(aDateOffsetED.GetSavedValue())) { InsertFld( nTypeId, nSubType, aEmptyStr, aVal, nFormat, ' ', aNumFormatLB.IsAutomaticLanguage() ); } diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index df419e9fe151..ba1871b7157a 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -276,9 +276,9 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) if(bDropDown) ListEnableHdl(0); - if( aNameFT.GetText() != sOldNameFT ) + if( aNameFT.GetText() != OUString(sOldNameFT) ) aNameFT.SetText(sOldNameFT); - if (aValueFT.GetText() != sOldValueFT) + if (aValueFT.GetText() != OUString(sOldValueFT)) aValueFT.SetText(sOldValueFT); switch (nTypeId) @@ -354,7 +354,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) aNameED.SetDropEnable(sal_True); bName = sal_True; - const sal_uInt16 nLen = aNameED.GetText().Len(); + const sal_Int32 nLen = aNameED.GetText().getLength(); if( !nLen || nLen > MAX_COMBINED_CHARACTERS ) bInsert = sal_False; aNameED.SetAccessibleName(aNameFT.GetText()); @@ -464,7 +464,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl) IMPL_LINK_NOARG(SwFldFuncPage, ListEnableHdl) { //enable "Add" button when text is in the Edit that's not already member of the box - aListAddPB.Enable(aListItemED.GetText().Len() && + aListAddPB.Enable(!aListItemED.GetText().isEmpty() && LISTBOX_ENTRY_NOTFOUND == aListItemsLB.GetEntryPos(aListItemED.GetText())); sal_Bool bEnableButtons = aListItemsLB.GetSelectEntryCount() > 0; aListRemovePB.Enable(bEnableButtons); @@ -593,11 +593,11 @@ sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& ) } if (!IsFldEdit() || - aNameED.GetSavedValue() != aNameED.GetText() || - aValueED.GetSavedValue() != aValueED.GetText() || - aCond1ED.GetSavedValue() != aCond1ED.GetText() || - aCond2ED.GetSavedValue() != aCond2ED.GetText() || - aListNameED.GetSavedValue() != aListNameED.GetText() || + OUString(aNameED.GetSavedValue()) != aNameED.GetText() || + OUString(aValueED.GetSavedValue()) != aValueED.GetText() || + OUString(aCond1ED.GetSavedValue()) != aCond1ED.GetText() || + OUString(aCond2ED.GetSavedValue()) != aCond2ED.GetText() || + OUString(aListNameED.GetSavedValue()) != aListNameED.GetText() || bDropDownLBChanged || nOldFormat != nFormat) { diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 520ae57cbce9..695a8f632df7 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -940,8 +940,8 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) } if (!IsFldEdit() || bModified || - aNameED.GetSavedValue() != aNameED.GetText() || - aValueED.GetSavedValue() != aValueED.GetText() || + OUString(aNameED.GetSavedValue()) != aNameED.GetText() || + OUString(aValueED.GetSavedValue()) != aValueED.GetText() || aTypeLB.GetSavedValue() != aTypeLB.GetSelectEntryPos() || aSelectionLB.GetSavedValue() != aSelectionLB.GetSelectEntryPos() || aFormatLB.GetSavedValue() != aFormatLB.GetSelectEntryPos()) diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index c9f90ab9bf71..2ae36613956e 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -226,9 +226,9 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) aValueED.SetText(GetFldMgr().GetCurFldPar2()); } - if (aNameFT.GetText() != sOldNameFT) + if (aNameFT.GetText() != OUString(sOldNameFT)) aNameFT.SetText(sOldNameFT); - if (aValueFT.GetText() != sOldValueFT) + if (aValueFT.GetText() != OUString(sOldValueFT)) aValueFT.SetText(sOldValueFT); aNumFormatLB.SetUpdateMode(sal_False); @@ -1097,7 +1097,7 @@ IMPL_LINK_NOARG(SwFldVarPage, ChapterHdl) IMPL_LINK_NOARG(SwFldVarPage, SeparatorHdl) { - sal_Bool bEnable = aSeparatorED.GetText().Len() != 0 || + sal_Bool bEnable = !aSeparatorED.GetText().isEmpty() || aChapterLevelLB.GetSelectEntryPos() == 0; EnableInsert(bEnable); @@ -1203,8 +1203,8 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) else { nSubType--; - String sSeparator = rtl::OUString(aSeparatorED.GetText().GetChar(0)); - cSeparator = sSeparator.Len() ? sSeparator.GetChar(0) : ' '; + OUString sSeparator = rtl::OUString(aSeparatorED.GetText()[0]); + cSeparator = !sSeparator.isEmpty() ? sSeparator[0] : ' '; } break; } @@ -1215,14 +1215,14 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) } if (!IsFldEdit() || - aNameED.GetSavedValue() != aNameED.GetText() || - aValueED.GetSavedValue() != aValueED.GetText() || + OUString(aNameED.GetSavedValue()) != aNameED.GetText() || + OUString(aValueED.GetSavedValue()) != aValueED.GetText() || aSelectionLB.GetSavedValue() != aSelectionLB.GetSelectEntryPos() || aFormatLB.GetSavedValue() != aFormatLB.GetSelectEntryPos() || nOldFormat != aNumFormatLB.GetFormat() || aInvisibleCB.GetState() != aInvisibleCB.GetSavedValue() || aChapterLevelLB.GetSavedValue() != aChapterLevelLB.GetSelectEntryPos() || - aSeparatorED.GetSavedValue() != aSeparatorED.GetText()) + OUString(aSeparatorED.GetSavedValue()) != aSeparatorED.GetText()) { InsertFld( nTypeId, nSubType, aName, aVal, nFormat, cSeparator, aNumFormatLB.IsAutomaticLanguage() ); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index 5751aca74b75..f933604d40f6 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -268,7 +268,7 @@ void SwCaptionDialog::Apply() aOpt.SetNumSeparator( m_pNumberingSeparatorED->GetText() ); } aOpt.SetNumType( (sal_uInt16)(sal_uIntPtr)m_pFormatBox->GetEntryData( m_pFormatBox->GetSelectEntryPos() ) ); - aOpt.SetSeparator( m_pSepEdit->IsEnabled() ? m_pSepEdit->GetText() : String() ); + aOpt.SetSeparator( m_pSepEdit->IsEnabled() ? m_pSepEdit->GetText() : OUString() ); aOpt.SetCaption( m_pTextEdit->GetText() ); aOpt.SetPos( m_pPosBox->GetSelectEntryPos() ); aOpt.IgnoreSeqOpts() = sal_True; @@ -463,7 +463,7 @@ void SwSequenceOptionDialog::Apply() RES_SETEXPFLD, aFldTypeName ); sal_Int8 nLvl = (sal_Int8)( m_pLbLevel->GetSelectEntryPos() - 1); - sal_Unicode cDelim = m_pEdDelim->GetText().GetChar(0); + sal_Unicode cDelim = m_pEdDelim->GetText()[0]; sal_Bool bUpdate = sal_True; if( pFldType ) diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 051b9dd30fb6..82ac9346884b 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -979,7 +979,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) aHoriOrient.SetRelationOrient( eRel ); aHoriOrient.SetPosToggle(aMirrorPagesCB.IsChecked()); - sal_Bool bMod = aAtHorzPosED.GetText() != aAtHorzPosED.GetSavedValue(); + sal_Bool bMod = aAtHorzPosED.GetText() != OUString(aAtHorzPosED.GetSavedValue()); bMod |= aMirrorPagesCB.GetState() != aMirrorPagesCB.GetSavedValue(); if ( eHOri == text::HoriOrientation::NONE && @@ -1017,7 +1017,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) aVertOrient.SetVertOrient ( eVOri); aVertOrient.SetRelationOrient( eRel ); - sal_Bool bMod = aAtVertPosED.GetText() != aAtVertPosED.GetSavedValue(); + sal_Bool bMod = aAtVertPosED.GetText() != OUString(aAtVertPosED.GetSavedValue()); if ( eVOri == text::VertOrientation::NONE && ( bNew || (bAtVertPosModified || bMod) || nOldV != eVOri) ) @@ -2678,7 +2678,7 @@ sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) String sText = aURLED.GetText(); if( pFmtURL->GetURL() != sText || - pFmtURL->GetName() != aNameED.GetText() || + OUString(pFmtURL->GetName()) != aNameED.GetText() || aServerCB.IsChecked() != pFmtURL->IsServerMap() ) { pFmtURL->SetURL( sText, aServerCB.IsChecked() ); @@ -2693,7 +2693,7 @@ sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) bModified = sal_True; } - if(pFmtURL->GetTargetFrameName() != aFrameCB.GetText()) + if(OUString(pFmtURL->GetTargetFrameName()) != aFrameCB.GetText()) { pFmtURL->SetTargetFrameName(aFrameCB.GetText()); bModified = sal_True; @@ -2982,9 +2982,9 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bRet = sal_False; - if (aNameED.GetText() != aNameED.GetSavedValue()) + if (aNameED.GetText() != OUString(aNameED.GetSavedValue())) bRet |= 0 != rSet.Put(SfxStringItem(FN_SET_FRM_NAME, aNameED.GetText())); - if (aAltNameED.GetText() != aAltNameED.GetSavedValue()) + if (aAltNameED.GetText() != OUString(aAltNameED.GetSavedValue())) bRet |= 0 != rSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, aAltNameED.GetText())); const SfxPoolItem* pOldItem; @@ -3048,7 +3048,7 @@ sal_uInt16* SwFrmAddPage::GetRanges() IMPL_LINK_NOARG(SwFrmAddPage, EditModifyHdl) { - sal_Bool bEnable = 0 != aNameED.GetText().Len(); + sal_Bool bEnable = !aNameED.GetText().isEmpty(); aAltNameED.Enable(bEnable); aAltNameFT.Enable(bEnable); diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx index 56e6926ca068..600167ddbbf6 100644 --- a/sw/source/ui/inc/dbinsdlg.hxx +++ b/sw/source/ui/inc/dbinsdlg.hxx @@ -140,7 +140,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem SfxItemSet* pTblSet; SwTableRep* pRep; - sal_uInt16 nGBFmtLen; + sal_Int32 nGBFmtLen; DECL_LINK( PageHdl, Button* ); DECL_LINK( AutoFmtHdl, PushButton* ); diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx index 3aca77b8afe7..26b8e917a630 100644 --- a/sw/source/ui/inc/swlbox.hxx +++ b/sw/source/ui/inc/swlbox.hxx @@ -106,7 +106,7 @@ public: sal_uInt16 GetStyle() const { return nStyle; } void SetStyle(const sal_uInt16 nSt) { nStyle = nSt; } - String GetText() const; + OUString GetText() const; }; #endif /* _SWLBOX_HXX */ diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 7feb49d413c2..5c275f5cd034 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1059,7 +1059,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription() const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType(); SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aCurType); aReadOnlyCB.Check(rDesc.IsReadonly()); - if(aTitleED.GetText() == aTitleED.GetSavedValue()) + if(aTitleED.GetText() == OUString(aTitleED.GetSavedValue())) { if(rDesc.GetTitle()) aTitleED.SetText(*rDesc.GetTitle()); @@ -1625,9 +1625,9 @@ void SwTOXEdit::RequestHelp( const HelpEvent& rHEvt ) void SwTOXEdit::KeyInput( const KeyEvent& rKEvt ) { const Selection& rSel = GetSelection(); - sal_uInt16 nTextLen = GetText().Len(); + sal_Int32 nTextLen = GetText().getLength(); if((rSel.A() == rSel.B() && - !rSel.A()) || rSel.A() == nTextLen ) + !rSel.A()) || rSel.A() == (sal_uInt16)nTextLen ) { sal_Bool bCall = sal_False; KeyCode aCode = rKEvt.GetKeyCode(); @@ -2732,8 +2732,8 @@ IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox) if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) { sal_Unicode cSet; - if( pBox->GetText().Len() ) - cSet = pBox->GetText().GetChar(0); + if( !pBox->GetText().isEmpty() ) + cSet = pBox->GetText()[0]; else cSet = ' '; ((SwTOXButton*)pCtrl)->SetFillChar( cSet ); @@ -3602,10 +3602,10 @@ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) if (!isNext) { - sal_uInt16 nLen = static_cast<SwTOXEdit*>(pCtrlFocus)->GetText().Len(); + sal_Int32 nLen = static_cast<SwTOXEdit*>(pCtrlFocus)->GetText().getLength(); - aSel.A() = nLen; - aSel.B() = nLen; + aSel.A() = (sal_uInt16)nLen; + aSel.B() = (sal_uInt16)nLen; } static_cast<SwTOXEdit*>(pCtrlFocus)->SetSelection(aSel); diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 9e2e3b0deff3..dfe6b4f83d34 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -488,7 +488,7 @@ void SwIndexMarkPane::InsertMark() aDesc.SetTOUName(aName); } } - if (aOrgStr != m_pEntryED->GetText()) + if (OUString(aOrgStr) != m_pEntryED->GetText()) aDesc.SetAltStr(m_pEntryED->GetText()); sal_Bool bApplyAll = m_pApplyToAllCB->IsChecked(); sal_Bool bWordOnly = m_pSearchCaseWordOnlyCB->IsChecked(); @@ -516,7 +516,7 @@ void SwIndexMarkPane::InsertMark() void SwIndexMarkPane::UpdateMark() { String aAltText(m_pEntryED->GetText()); - String* pAltText = aOrgStr != m_pEntryED->GetText() ? &aAltText : 0; + String* pAltText = OUString(aOrgStr) != m_pEntryED->GetText() ? &aAltText : 0; //empty alternative texts are not allowed if(pAltText && !pAltText->Len()) return; @@ -613,7 +613,7 @@ void SwNewUserIdxDlg::Apply() IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit) { - aOKPB.Enable(pEdit->GetText().Len() && !pDlg->IsTOXType(pEdit->GetText())); + aOKPB.Enable(!pEdit->GetText().isEmpty() && !pDlg->IsTOXType(pEdit->GetText())); return 0; } @@ -680,19 +680,19 @@ IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) bKey2HasText = sal_False; if(nPos == POS_INDEX) { - if(m_pEntryED->GetText().Len()) + if(!m_pEntryED->GetText().isEmpty()) bEntryHasText = sal_True; m_pPhoneticED0->SetText(GetDefaultPhoneticReading(m_pEntryED->GetText())); bKeyEnable = sal_True; m_pKey1DCB->SetText(m_pKey1DCB->GetEntry(nKey1Pos)); m_pPhoneticED1->SetText(GetDefaultPhoneticReading(m_pKey1DCB->GetText())); - if(m_pKey1DCB->GetText().Len() > 0) + if(!m_pKey1DCB->GetText().isEmpty()) { bKey1HasText = bSetKey2 = bKey2Enable = sal_True; m_pKey2DCB->SetText(m_pKey2DCB->GetEntry(nKey2Pos)); m_pPhoneticED2->SetText(GetDefaultPhoneticReading(m_pKey2DCB->GetText())); - if(m_pKey2DCB->GetText().Len()) + if(!m_pKey2DCB->GetText().isEmpty()) bKey2HasText = sal_True; } } @@ -723,7 +723,7 @@ IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) } else //m_pEntryED !!m_pEntryED is not a ListBox but a Edit { - sal_Bool bHasText = (m_pEntryED->GetText().Len()>0); + sal_Bool bHasText = (!m_pEntryED->GetText().isEmpty()); if(!bHasText) { m_pPhoneticED0->SetText(aEmptyStr); @@ -736,7 +736,7 @@ IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) m_pPhoneticED0->Enable(bHasText&&bIsPhoneticReadingEnabled); } m_pOKBT->Enable(!pSh->HasReadonlySel() && - (m_pEntryED->GetText().Len() || pSh->GetCrsrCnt(sal_False))); + (!m_pEntryED->GetText().isEmpty() || pSh->GetCrsrCnt(sal_False))); return 0; } @@ -904,15 +904,15 @@ IMPL_LINK( SwIndexMarkPane, PhoneticEDModifyHdl, Edit *, pEdit ) { if (m_pPhoneticED0 == pEdit) { - bPhoneticED0_ChangedByUser = pEdit->GetText().Len()>0; + bPhoneticED0_ChangedByUser = !pEdit->GetText().isEmpty(); } else if (m_pPhoneticED1 == pEdit) { - bPhoneticED1_ChangedByUser = pEdit->GetText().Len()>0; + bPhoneticED1_ChangedByUser = !pEdit->GetText().isEmpty(); } else if (m_pPhoneticED2 == pEdit) { - bPhoneticED2_ChangedByUser = pEdit->GetText().Len()>0; + bPhoneticED2_ChangedByUser = !pEdit->GetText().isEmpty(); } return 0; } @@ -924,7 +924,7 @@ IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) { if (m_pKey1DCB == pBox) { - sal_Bool bEnable = pBox->GetText().Len() > 0; + sal_Bool bEnable = !pBox->GetText().isEmpty(); if(!bEnable) { m_pKey2DCB->SetText(aEmptyStr); @@ -948,7 +948,7 @@ IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) } else if (m_pKey2DCB == pBox) { - if(!(pBox->GetText().Len()>0)) + if(pBox->GetText().isEmpty()) { m_pPhoneticED2->SetText(aEmptyStr); bPhoneticED2_ChangedByUser = sal_False; @@ -964,8 +964,8 @@ IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) m_pPhoneticED2->SetText(GetDefaultPhoneticReading(pBox->GetText())); } } - sal_Bool bKey1HasText = (0 != m_pKey1DCB->GetText().Len()); - sal_Bool bKey2HasText = (0 != m_pKey2DCB->GetText().Len()); + sal_Bool bKey1HasText = (!m_pKey1DCB->GetText().isEmpty()); + sal_Bool bKey2HasText = (!m_pKey2DCB->GetText().isEmpty()); m_pPhoneticFT1->Enable(bKey1HasText&&bIsPhoneticReadingEnabled); m_pPhoneticED1->Enable(bKey1HasText&bIsPhoneticReadingEnabled); diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 8ab55b4503d4..5d40a8b7b20e 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -103,10 +103,9 @@ void SwInsertBookmarkDlg::Apply() } // insert text mark - sal_uInt16 nLen = m_pBookmarkBox->GetText().Len(); SwBoxEntry aTmpEntry(m_pBookmarkBox->GetText(), 0 ); - if ( nLen && (m_pBookmarkBox->GetEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND) ) + if ( !m_pBookmarkBox->GetText().isEmpty() && (m_pBookmarkBox->GetEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND) ) { String sEntry(comphelper::string::remove(m_pBookmarkBox->GetText(), m_pBookmarkBox->GetMultiSelectionSeparator())); @@ -177,7 +176,7 @@ sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const for (; nPos < nCnt; nPos++) { - String sEntry(comphelper::string::strip(GetText().GetToken(nPos, cSep), ' ')); + String sEntry(comphelper::string::strip(GetText().getToken(nPos, cSep), ' ')); if (GetEntryPos(sEntry) != COMBOBOX_ENTRY_NOTFOUND) return nPos; } @@ -212,7 +211,7 @@ sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const if (nSelIndex == nCnt) { sal_Unicode cSep = GetMultiSelectionSeparator(); - String sEntry(comphelper::string::strip(GetText().GetToken(nPos, cSep), ' ')); + String sEntry(comphelper::string::strip(GetText().getToken(nPos, cSep), ' ')); return GetEntryPos(sEntry); } nPos = GetNextSelEntryPos(nPos); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index ecec7b1551a2..c5a38aefbc12 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -410,7 +410,7 @@ IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected(); const String aEditText(m_pNameED->GetText()); - const sal_Bool bHasEntry = aEditText.Len() && m_pShortNameEdit->GetText().Len(); + const sal_Bool bHasEntry = aEditText.Len() && !m_pShortNameEdit->GetText().isEmpty(); const sal_Bool bExists = 0 != DoesBlockExist(aEditText, m_pShortNameEdit->GetText()); const sal_Bool bIsGroup = pEntry && !m_pCategoryBox->GetParent(pEntry); pMn->EnableItem("new", bSelection && bHasEntry && !bExists); @@ -798,13 +798,13 @@ IMPL_LINK_NOARG_INLINE_END(SwGlossaryDlg, EditHdl) ------------------------------------------------------------------------*/ IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) { - String aName(aNewName.GetText()); + OUString aName(aNewName.GetText()); SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent(); if( pBox == &aNewName ) aNewShort.SetText( lcl_GetValidShortCut( aName ) ); - sal_Bool bEnable = aName.Len() && aNewShort.GetText().Len() && + sal_Bool bEnable = !aName.isEmpty() && !aNewShort.GetText().isEmpty() && (!pDlg->DoesBlockExist(aName, aNewShort.GetText()) || aName == aOldName.GetText()); aOk.Enable(bEnable); @@ -814,7 +814,7 @@ IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename) { SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParent(); - String sNew = GetAppCharClass().uppercase(aNewShort.GetText()); + OUString sNew = GetAppCharClass().uppercase(aNewShort.GetText()); if( pDlg->pGlossaryHdl->HasShortName(aNewShort.GetText()) && sNew != aOldShort.GetText() ) { diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 368550b6db5f..e455bfe992fa 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -87,7 +87,7 @@ void SwInsFootNoteDlg::Apply() IMPL_LINK_NOARG_INLINE_START(SwInsFootNoteDlg, NumberCharHdl) { m_pNumberCharEdit->GrabFocus(); - m_pOkBtn->Enable( m_pNumberCharEdit->GetText().Len() || bExtCharAvailable ); + m_pOkBtn->Enable( !m_pNumberCharEdit->GetText().isEmpty() || bExtCharAvailable ); return 0; } IMPL_LINK_NOARG_INLINE_END(SwInsFootNoteDlg, NumberCharHdl) @@ -95,7 +95,7 @@ IMPL_LINK_NOARG_INLINE_END(SwInsFootNoteDlg, NumberCharHdl) IMPL_LINK_NOARG_INLINE_START(SwInsFootNoteDlg, NumberEditHdl) { m_pNumberCharBtn->Check( sal_True ); - m_pOkBtn->Enable( 0 != m_pNumberCharEdit->GetText().Len() ); + m_pOkBtn->Enable( !m_pNumberCharEdit->GetText().isEmpty() ); return 0; } @@ -143,7 +143,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl) } bExtCharAvailable = sal_True; - m_pOkBtn->Enable(0 != m_pNumberCharEdit->GetText().Len()); + m_pOkBtn->Enable(!m_pNumberCharEdit->GetText().isEmpty()); } } delete pDlg; diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index 159d54bd5e3c..4a7b87e6d4b5 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -191,7 +191,7 @@ IMPL_LINK_NOARG(SwLineNumberingDlg, OKHdl) --------------------------------------------------------------------*/ IMPL_LINK_NOARG(SwLineNumberingDlg, ModifyHdl) { - bool bEnable = m_pNumberingOnCB->IsChecked() && m_pDivisorED->GetText().Len() != 0; + bool bEnable = m_pNumberingOnCB->IsChecked() && !m_pDivisorED->GetText().isEmpty(); m_pDivIntervalFT->Enable(bEnable); m_pDivIntervalNF->Enable(bEnable); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 5a4d9e31d45f..a5d114266984 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -117,7 +117,7 @@ void SwNumNamesDlg::SetUserNames(const String *pList[]) ------------------------------------------------------------------------*/ IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox ) { - aOKBtn.Enable(0 != pBox->GetText().Len()); + aOKBtn.Enable(!pBox->GetText().isEmpty()); return 0; } IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox ) diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 78f73fc72901..28d0566ef3a1 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -550,7 +550,7 @@ void InputEdit::UpdateRange(const String& rBoxes, //OS: mit dem folgenden Ausdruck wird sichergestellt, dass im overwrite-Modus //die selektierte schliessende Klammer nicht geloescht wird if( nSel && ( nSel > 1 || - GetText().GetChar( (sal_uInt16)aSelection.Min() ) != cClose ) ) + GetText()[ (sal_uInt16)aSelection.Min() ] != cClose )) Cut(); else aSelection.Max() = aSelection.Min(); @@ -617,7 +617,7 @@ void InputEdit::UpdateRange(const String& rBoxes, aActText.Insert( aTmp, nPos ); nPos = nPos + aTmp.getLength(); } - if( GetText() != aActText ) + if( GetText() != OUString(aActText) ) { SetText( aActText ); SetSelection( Selection( nPos, nPos ) ); diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index e1bc1d6e272e..2beeaef07aa6 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -61,9 +61,9 @@ void SwConvertTableDlg::GetValues( sal_Unicode& rDelim, rDelim = ';'; nSaveButtonState = 1; } - else if( mpOtherBtn->IsChecked() && mpOtherEd->GetText().Len() ) + else if( mpOtherBtn->IsChecked() && !mpOtherEd->GetText().isEmpty() ) { - uOther = mpOtherEd->GetText().GetChar( 0 ); + uOther = mpOtherEd->GetText()[0]; rDelim = uOther; nSaveButtonState = 3; } diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index cb8f631c006d..4c4da43aca89 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -398,8 +398,8 @@ sal_Bool SwFormatTablePage::FillItemSet( SfxItemSet& rCoreSet ) if(bModified) { - if( m_pBottomMF->GetText() != m_pBottomMF->GetSavedValue() || - m_pTopMF->GetText() != m_pTopMF->GetSavedValue() ) + if( m_pBottomMF->GetText() != OUString(m_pBottomMF->GetSavedValue()) || + m_pTopMF->GetText() != OUString(m_pTopMF->GetSavedValue()) ) { SvxULSpaceItem aULSpace(RES_UL_SPACE); aULSpace.SetUpper( (sal_uInt16) m_pTopMF->Denormalize( @@ -410,7 +410,7 @@ sal_Bool SwFormatTablePage::FillItemSet( SfxItemSet& rCoreSet ) } } - if(m_pNameED->GetText() != m_pNameED->GetSavedValue()) + if(m_pNameED->GetText() != OUString(m_pNameED->GetSavedValue())) { rCoreSet.Put(SfxStringItem( FN_PARAM_TABLE_NAME, m_pNameED->GetText())); bModified = sal_True; |