[Libreoffice-commits] core.git: cui/source fpicker/source include/svl svtools/source vcl/source
Thomas Arnhold
thomas at arnhold.org
Sun Oct 20 18:09:05 PDT 2013
cui/source/tabpages/numfmt.cxx | 2 +-
fpicker/source/office/iodlg.cxx | 2 +-
include/svl/zformat.hxx | 3 +--
svtools/source/control/inettbc.cxx | 4 ++--
vcl/source/gdi/outdev3.cxx | 22 +++++++++++-----------
vcl/source/gdi/pdfwriter_impl.cxx | 2 +-
vcl/source/window/menu.cxx | 4 ++--
7 files changed, 19 insertions(+), 20 deletions(-)
New commits:
commit 051731bbcaa79b6428c8ebee6c114c9b28220cc8
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Mon Oct 21 01:47:57 2013 +0200
post String conversion cleanup
Change-Id: I9747817edc76973af4a4ffdbf542b8d1467d7f08
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 042d052..5552c3a 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -75,7 +75,7 @@ static sal_uInt16 pRanges[] =
SvxNumberPreview::SvxNumberPreview(Window* pParent, WinBits nStyle)
: Window(pParent, nStyle)
- , mnPos(STRING_NOTFOUND)
+ , mnPos(-1)
, mnChar(0x0)
{
Font aFont( GetFont() );
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 64bce13..379df0d 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -2176,7 +2176,7 @@ short SvtFileDialog::PrepareExecute()
// create and show instance for set path
INetURLObject aFolderURL( _aPath );
OUString aFileName( aFolderURL.getName( INetURLObject::LAST_SEGMENT, false ) );
- xub_StrLen nFileNameLen = aFileName.getLength();
+ sal_Int32 nFileNameLen = aFileName.getLength();
bool bFileToSelect = nFileNameLen != 0;
if ( bFileToSelect && aFileName[ nFileNameLen - 1 ] != INET_PATH_TOKEN )
{
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 6e06a83..7b7eca0 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -371,8 +371,7 @@ public:
/**
Return the position of a matching closing cQuote if the character at
- position nPos is between two matching cQuote, otherwise return
- STRING_NOTFOUND.
+ position nPos is between two matching cQuote, otherwise return -1.
If nPos points to an opening cQuote the position of the matching
closing cQuote is returned.
If nPos points to a closing cQuote nPos is returned.
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index ad63c28..00dbfbb 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -350,7 +350,7 @@ void SvtMatchContext_Impl::ReadFolder( const OUString& rURL,
aMatchName += "/";
}
- xub_StrLen nMatchLen = aMatchName.getLength();
+ sal_Int32 nMatchLen = aMatchName.getLength();
INetURLObject aFolderObj( rURL );
DBG_ASSERT( aFolderObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
@@ -1344,7 +1344,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
// in case the path is "~username" then there should
// be no trailing slash at the end
- if( nNameEnd == STRING_NOTFOUND )
+ if( nNameEnd == -1 )
bTrailingSlash = sal_False;
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 2a0eb11..96ad632 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6142,7 +6142,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nTextHeight = rTargetDevice.GetTextHeight();
TextAlign eAlign = rTargetDevice.GetTextAlign();
- sal_Int32 nMnemonicPos = STRING_NOTFOUND;
+ sal_Int32 nMnemonicPos = -1;
OUString aStr = rOrigStr;
if ( nStyle & TEXT_DRAW_MNEMONIC )
@@ -6307,7 +6307,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nMnemonicX = 0;
long nMnemonicY = 0;
long nMnemonicWidth = 0;
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.getLength() );
/*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.getLength() );
@@ -6327,7 +6327,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
_rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
if ( bDrawMnemonics )
{
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
rTargetDevice.Pop();
@@ -6337,7 +6337,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
_rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
if ( bDrawMnemonics )
{
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
}
@@ -6718,7 +6718,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
nLen = rStr.getLength() - nIndex;
OUString aStr = rStr;
- sal_Int32 nMnemonicPos = STRING_NOTFOUND;
+ sal_Int32 nMnemonicPos = -1;
long nMnemonicX = 0;
long nMnemonicY = 0;
@@ -6726,7 +6726,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
if ( (nStyle & TEXT_DRAW_MNEMONIC) && nLen > 1 )
{
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
{
if( nMnemonicPos < nIndex )
--nIndex;
@@ -6803,7 +6803,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
{
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
SetTextColor( aOldTextColor );
@@ -6815,7 +6815,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
{
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
}
@@ -6834,7 +6834,7 @@ long OutputDevice::GetCtrlTextWidth( const OUString& rStr,
{
sal_Int32 nMnemonicPos;
OUString aStr = GetNonMnemonicString( rStr, nMnemonicPos );
- if ( nMnemonicPos != STRING_NOTFOUND )
+ if ( nMnemonicPos != -1 )
{
if ( nMnemonicPos < nIndex )
nIndex--;
@@ -6854,14 +6854,14 @@ OUString OutputDevice::GetNonMnemonicString( const OUString& rStr, sal_Int32& rM
sal_Int32 nLen = aStr.getLength();
sal_Int32 i = 0;
- rMnemonicPos = STRING_NOTFOUND;
+ rMnemonicPos = -1;
while ( i < nLen )
{
if ( aStr[ i ] == '~' )
{
if ( aStr[ i+1 ] != '~' )
{
- if ( rMnemonicPos == STRING_NOTFOUND )
+ if ( rMnemonicPos == -1 )
rMnemonicPos = i;
aStr = aStr.replaceAt( i, 1, "" );
nLen--;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 1349e05..fa35683 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7896,7 +7896,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr,
Point aPos = rRect.TopLeft();
long nTextHeight = m_pReferenceDevice->GetTextHeight();
- sal_Int32 nMnemonicPos = STRING_NOTFOUND;
+ sal_Int32 nMnemonicPos = -1;
OUString aStr = rOrigStr;
if ( nStyle & TEXT_DRAW_MNEMONIC )
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index ab693ea..214b656 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2596,11 +2596,11 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
static OUString getShortenedString( const OUString& i_rLong, Window* i_pWin, long i_nMaxWidth )
{
- sal_Int32 nPos = STRING_NOTFOUND;
+ sal_Int32 nPos = -1;
OUString aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) );
aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS );
// re-insert mnemonic
- if( nPos != STRING_NOTFOUND )
+ if( nPos != -1 )
{
if( nPos < aNonMnem.getLength() && i_rLong[nPos+1] == aNonMnem[nPos] )
{
More information about the Libreoffice-commits
mailing list