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/source/ui/index | |
parent | 87f9d7da00857c649784a7d9eca046bf6e71ae3c (diff) |
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/source/ui/index')
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 30 |
2 files changed, 23 insertions, 23 deletions
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); |