Kaydet (Commit) 3270fc62 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith Kaydeden (comit) Norbert Thiebaud

use OUString(Buffer) in class Edit

replaced Len() with isEmpty() where appropriate

Change-Id: I5a5847d6055f376fd5f86079aa1736541d790fff
Reviewed-on: https://gerrit.libreoffice.org/1892Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
üst 71ca001a
...@@ -1710,7 +1710,7 @@ sal_Bool OFieldDescControl::isCopyAllowed() ...@@ -1710,7 +1710,7 @@ sal_Bool OFieldDescControl::isCopyAllowed()
m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength ||
m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName ||
m_pActFocusWindow == m_pAutoIncrementValue) && m_pActFocusWindow == m_pAutoIncrementValue) &&
static_cast<Edit*>(m_pActFocusWindow)->GetSelected().Len() != 0; !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty();
return bAllowed; return bAllowed;
} }
...@@ -1722,7 +1722,7 @@ sal_Bool OFieldDescControl::isCutAllowed() ...@@ -1722,7 +1722,7 @@ sal_Bool OFieldDescControl::isCutAllowed()
m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength ||
m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName ||
m_pActFocusWindow == m_pAutoIncrementValue) && m_pActFocusWindow == m_pAutoIncrementValue) &&
static_cast<Edit*>(m_pActFocusWindow)->GetSelected().Len() != 0; !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty();
return bAllowed; return bAllowed;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -111,7 +111,7 @@ void OQueryTextView::copy() ...@@ -111,7 +111,7 @@ void OQueryTextView::copy()
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool OQueryTextView::isCutAllowed() sal_Bool OQueryTextView::isCutAllowed()
{ {
return m_pEdit->GetSelected().Len() != 0; return !m_pEdit->GetSelected().isEmpty();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool OQueryTextView::isPasteAllowed() sal_Bool OQueryTextView::isPasteAllowed()
......
...@@ -2501,10 +2501,10 @@ sal_Bool OSelectionBrowseBox::isCutAllowed() ...@@ -2501,10 +2501,10 @@ sal_Bool OSelectionBrowseBox::isCutAllowed()
case BROW_FUNCTION_ROW: case BROW_FUNCTION_ROW:
break; break;
case BROW_FIELD_ROW: case BROW_FIELD_ROW:
bCutAllowed = m_pFieldCell->GetSelected().Len() != 0; bCutAllowed = !m_pFieldCell->GetSelected().isEmpty();
break; break;
default: default:
bCutAllowed = m_pTextCell->GetSelected().Len() != 0; bCutAllowed = !m_pTextCell->GetSelected().isEmpty();
break; break;
} }
return bCutAllowed; return bCutAllowed;
......
...@@ -1299,13 +1299,13 @@ sal_Bool OTableEditorCtrl::IsCutAllowed( long nRow ) ...@@ -1299,13 +1299,13 @@ sal_Bool OTableEditorCtrl::IsCutAllowed( long nRow )
switch(m_eChildFocus) switch(m_eChildFocus)
{ {
case DESCRIPTION: case DESCRIPTION:
bIsCutAllowed = pDescrCell->GetSelected().Len() != 0; bIsCutAllowed = !pDescrCell->GetSelected().isEmpty();
break; break;
case HELPTEXT: case HELPTEXT:
bIsCutAllowed = pHelpTextCell->GetSelected().Len() != 0; bIsCutAllowed = !pHelpTextCell->GetSelected().isEmpty();
break; break;
case NAME: case NAME:
bIsCutAllowed = pNameCell->GetSelected().Len() != 0; bIsCutAllowed = !pNameCell->GetSelected().isEmpty();
break; break;
case ROW: case ROW:
bIsCutAllowed = IsCopyAllowed(nRow); bIsCutAllowed = IsCopyAllowed(nRow);
...@@ -1325,15 +1325,15 @@ sal_Bool OTableEditorCtrl::IsCopyAllowed( long /*nRow*/ ) ...@@ -1325,15 +1325,15 @@ sal_Bool OTableEditorCtrl::IsCopyAllowed( long /*nRow*/ )
DBG_CHKTHIS(OTableEditorCtrl,NULL); DBG_CHKTHIS(OTableEditorCtrl,NULL);
sal_Bool bIsCopyAllowed = sal_False; sal_Bool bIsCopyAllowed = sal_False;
if(m_eChildFocus == DESCRIPTION ) if(m_eChildFocus == DESCRIPTION )
bIsCopyAllowed = pDescrCell->GetSelected().Len() != 0; bIsCopyAllowed = !pDescrCell->GetSelected().isEmpty();
else if(HELPTEXT == m_eChildFocus ) else if(HELPTEXT == m_eChildFocus )
bIsCopyAllowed = pHelpTextCell->GetSelected().Len() != 0; bIsCopyAllowed = !pHelpTextCell->GetSelected().isEmpty();
else if(m_eChildFocus == NAME) else if(m_eChildFocus == NAME)
bIsCopyAllowed = pNameCell->GetSelected().Len() != 0; bIsCopyAllowed = !pNameCell->GetSelected().isEmpty();
else if(m_eChildFocus == ROW) else if(m_eChildFocus == ROW)
{ {
Reference<XPropertySet> xTable = GetView()->getController().getTable(); Reference<XPropertySet> xTable = GetView()->getController().getTable();
if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")))) if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == "VIEW"))
return sal_False; return sal_False;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
...@@ -1500,9 +1500,9 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ ) ...@@ -1500,9 +1500,9 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ )
Reference<XPropertySet> xTable = rController.getTable(); Reference<XPropertySet> xTable = rController.getTable();
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Key darf nicht veraendert werden // Key darf nicht veraendert werden
// Dies gilt jedoch nur, wenn die Tabelle nicht neu ist und keine ::com::sun::star::sdbcx::View. Ansonsten wird kein DROP ausgefhrt // Dies gilt jedoch nur, wenn die Tabelle nicht neu ist und keine ::com::sun::star::sdbcx::View. Ansonsten wird kein DROP ausgefuehrt
if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"))) if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == "VIEW")
return sal_False; return sal_False;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Wenn leeres Feld, kein PrimKey // Wenn leeres Feld, kein PrimKey
......
...@@ -84,7 +84,7 @@ long OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt ) ...@@ -84,7 +84,7 @@ long OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt )
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool OTableDesignHelpBar::isCopyAllowed() sal_Bool OTableDesignHelpBar::isCopyAllowed()
{ {
return m_pTextWin && m_pTextWin->GetSelected().Len(); return m_pTextWin && !m_pTextWin->GetSelected().isEmpty();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool OTableDesignHelpBar::isCutAllowed() sal_Bool OTableDesignHelpBar::isCutAllowed()
......
...@@ -61,11 +61,11 @@ private: ...@@ -61,11 +61,11 @@ private:
Timer* mpUpdateDataTimer; Timer* mpUpdateDataTimer;
DDInfo* mpDDInfo; DDInfo* mpDDInfo;
Impl_IMEInfos* mpIMEInfos; Impl_IMEInfos* mpIMEInfos;
XubString maText; OUStringBuffer maText;
OUString maPlaceholderText; OUString maPlaceholderText;
OUString maSaveValue; OUString maSaveValue;
XubString maUndoText; OUString maUndoText;
XubString maRedoText; OUString maRedoText;
long mnXOffset; long mnXOffset;
Selection maSelection; Selection maSelection;
sal_uInt16 mnAlign; sal_uInt16 mnAlign;
...@@ -73,7 +73,7 @@ private: ...@@ -73,7 +73,7 @@ private:
sal_Int32 mnWidthInChars; sal_Int32 mnWidthInChars;
AutocompleteAction meAutocompleteAction; AutocompleteAction meAutocompleteAction;
sal_Unicode mcEchoChar; sal_Unicode mcEchoChar;
sal_Bool mbModified:1, sal_Bool mbModified:1,
mbInternModified:1, mbInternModified:1,
mbReadOnly:1, mbReadOnly:1,
mbInsertMode:1, mbInsertMode:1,
...@@ -90,13 +90,13 @@ private: ...@@ -90,13 +90,13 @@ private:
SAL_DLLPRIVATE bool ImplTruncateToMaxLen( rtl::OUString&, sal_uInt32 nSelectionLen ) const; SAL_DLLPRIVATE bool ImplTruncateToMaxLen( rtl::OUString&, sal_uInt32 nSelectionLen ) const;
SAL_DLLPRIVATE void ImplInitEditData(); SAL_DLLPRIVATE void ImplInitEditData();
SAL_DLLPRIVATE void ImplModified(); SAL_DLLPRIVATE void ImplModified();
SAL_DLLPRIVATE XubString ImplGetText() const; SAL_DLLPRIVATE OUString ImplGetText() const;
SAL_DLLPRIVATE void ImplRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN, bool bLayout = false ); SAL_DLLPRIVATE void ImplRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN, bool bLayout = false );
SAL_DLLPRIVATE void ImplInvalidateOrRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN ); SAL_DLLPRIVATE void ImplInvalidateOrRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN );
SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode ); SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
SAL_DLLPRIVATE void ImplSetText( const XubString& rStr, const Selection* pNewSelection = 0 ); SAL_DLLPRIVATE void ImplSetText( const OUString& rStr, const Selection* pNewSelection = 0 );
SAL_DLLPRIVATE void ImplInsertText( const rtl::OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False ); SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False );
SAL_DLLPRIVATE String ImplGetValidString( const String& rString ) const; SAL_DLLPRIVATE OUString ImplGetValidString( const OUString& rString ) const;
SAL_DLLPRIVATE void ImplClearBackground( long nXStart, long nXEnd ); SAL_DLLPRIVATE void ImplClearBackground( long nXStart, long nXEnd );
SAL_DLLPRIVATE void ImplPaintBorder( long nXStart, long nXEnd ); SAL_DLLPRIVATE void ImplPaintBorder( long nXStart, long nXEnd );
SAL_DLLPRIVATE void ImplShowCursor( sal_Bool bOnlyIfVisible = sal_True ); SAL_DLLPRIVATE void ImplShowCursor( sal_Bool bOnlyIfVisible = sal_True );
...@@ -197,9 +197,9 @@ public: ...@@ -197,9 +197,9 @@ public:
virtual void SetSelection( const Selection& rSelection ); virtual void SetSelection( const Selection& rSelection );
virtual const Selection& GetSelection() const; virtual const Selection& GetSelection() const;
virtual void ReplaceSelected( const XubString& rStr ); virtual void ReplaceSelected( const OUString& rStr );
virtual void DeleteSelected(); virtual void DeleteSelected();
virtual XubString GetSelected() const; virtual OUString GetSelected() const;
virtual void Cut(); virtual void Cut();
virtual void Copy(); virtual void Copy();
......
...@@ -84,10 +84,10 @@ public: ...@@ -84,10 +84,10 @@ public:
virtual void SetSelection( const Selection& rSelection ); virtual void SetSelection( const Selection& rSelection );
virtual const Selection& GetSelection() const; virtual const Selection& GetSelection() const;
virtual void ReplaceSelected( const XubString& rStr ); virtual void ReplaceSelected( const OUString& rStr );
virtual void DeleteSelected(); virtual void DeleteSelected();
virtual XubString GetSelected() const; virtual OUString GetSelected() const;
virtual XubString GetSelected( LineEnd aSeparator ) const; virtual OUString GetSelected( LineEnd aSeparator ) const;
virtual void Cut(); virtual void Cut();
virtual void Copy(); virtual void Copy();
......
This diff is collapsed.
...@@ -1126,7 +1126,7 @@ xub_StrLen VclMultiLineEdit::GetMaxTextLen() const ...@@ -1126,7 +1126,7 @@ xub_StrLen VclMultiLineEdit::GetMaxTextLen() const
return pImpVclMEdit->GetMaxTextLen(); return pImpVclMEdit->GetMaxTextLen();
} }
void VclMultiLineEdit::ReplaceSelected( const String& rStr ) void VclMultiLineEdit::ReplaceSelected( const OUString& rStr )
{ {
pImpVclMEdit->InsertText( rStr ); pImpVclMEdit->InsertText( rStr );
} }
...@@ -1136,12 +1136,12 @@ void VclMultiLineEdit::DeleteSelected() ...@@ -1136,12 +1136,12 @@ void VclMultiLineEdit::DeleteSelected()
pImpVclMEdit->InsertText( String() ); pImpVclMEdit->InsertText( String() );
} }
String VclMultiLineEdit::GetSelected() const OUString VclMultiLineEdit::GetSelected() const
{ {
return pImpVclMEdit->GetSelected(); return pImpVclMEdit->GetSelected();
} }
String VclMultiLineEdit::GetSelected( LineEnd aSeparator ) const OUString VclMultiLineEdit::GetSelected( LineEnd aSeparator ) const
{ {
return pImpVclMEdit->GetSelected( aSeparator ); return pImpVclMEdit->GetSelected( aSeparator );
} }
......
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