[Libreoffice-commits] .: 3 commits - configure.in forms/source reportdesign/source sc/source sd/source starmath/source svl/inc svl/source sw/source tools/inc tools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue May 15 04:45:34 PDT 2012
configure.in | 3
forms/source/component/DatabaseForm.cxx | 80 +++++++++++----------
reportdesign/source/ui/report/ReportController.cxx | 2
sc/source/ui/view/tabvwshb.cxx | 8 +-
sd/source/ui/view/viewshel.cxx | 3
starmath/source/document.cxx | 2
svl/inc/svl/undo.hxx | 8 +-
svl/source/undo/undo.cxx | 8 --
sw/source/ui/shells/annotsh.cxx | 2
sw/source/ui/shells/drwtxtsh.cxx | 2
tools/inc/tools/inetmsg.hxx | 4 -
tools/source/inet/inetmsg.cxx | 2
12 files changed, 64 insertions(+), 60 deletions(-)
New commits:
commit f887c77064a5ae8694af30f6bf24a6c61bd902ef
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 15 12:44:18 2012 +0100
Related: rhbz#162935 Document reason for stl header visibility check
Change-Id: I63edb1931975eca15a0b1efc51f9ce0d35739ebc
diff --git a/configure.in b/configure.in
index 9345e9d..b1640ea 100644
--- a/configure.in
+++ b/configure.in
@@ -4709,7 +4709,8 @@ if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
fi
if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
- AC_MSG_CHECKING([if STL headers are visibility safe])
+ dnl gcc#19664, gcc#22482, rhbz#162935
+ AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
AC_MSG_RESULT([$stlvisok])
if test "$stlvisok" = "no"; then
commit 51eb0d79c122be86bb6fb4137c6d5ff26cc7e1d7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 15 12:04:22 2012 +0100
ditch UniString
Change-Id: I0671f0acf5a53a1c7f442f721bb058a3760ca18c
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index a41fd7c..287594d 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -598,7 +598,7 @@ Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const Reference<XContr
void* pData = (void*)aMemStream.GetData();
sal_Int32 nLen = aMemStream.Seek(STREAM_SEEK_TO_END);
- rContentType = UniString(aParent.GetContentType());
+ rContentType = aParent.GetContentType();
return Sequence<sal_Int8>((sal_Int8*)pData, nLen);
}
@@ -669,18 +669,23 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
if (xSubmitButtonComponent == xComponentSet)
{
// <name>.x=<pos.X>&<name>.y=<pos.Y>
- ::rtl::OUString aLhs = aName;
::rtl::OUString aRhs = ::rtl::OUString::valueOf( MouseEvt.X );
// Only if a name is available we have a name.x
- aLhs += !aName.isEmpty() ? UniString::CreateFromAscii(".x") : UniString::CreateFromAscii("x");
- rList.push_back( HtmlSuccessfulObj(aLhs, aRhs) );
-
- aLhs = aName;
+ rtl::OUStringBuffer aLhs(aName);
+ if (!aName.isEmpty())
+ aLhs.append(".x");
+ else
+ aLhs.append("x");
+ rList.push_back( HtmlSuccessfulObj(aLhs.makeStringAndClear(), aRhs) );
+
+ aLhs.append(aName);
aRhs = ::rtl::OUString::valueOf( MouseEvt.Y );
- aLhs += !aName.isEmpty() ? UniString::CreateFromAscii(".y") : UniString::CreateFromAscii("y");
- rList.push_back( HtmlSuccessfulObj(aLhs, aRhs) );
-
+ if (!aName.isEmpty())
+ aLhs.append(".y");
+ else
+ aLhs.append("y");
+ rList.push_back( HtmlSuccessfulObj(aLhs.makeStringAndClear(), aRhs) );
}
}
} break;
@@ -921,7 +926,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
if (!xContainer.is())
break;
- aName += UniString('.');
+ aName += rtl::OUString(static_cast<sal_Unicode>('.'));
Reference<XPropertySet> xSet;
sal_Int32 nCount = xContainer->getCount();
@@ -961,7 +966,7 @@ void ODatabaseForm::FillSuccessfulList( HtmlSuccessfulObjList& rList,
//------------------------------------------------------------------------
void ODatabaseForm::Encode( ::rtl::OUString& rString ) const
{
- ::rtl::OUString aResult;
+ ::rtl::OUStringBuffer aResult;
// Line endings are represented as CR
rString = convertLineEnd(rString, LINEEND_CR);
@@ -979,7 +984,7 @@ void ODatabaseForm::Encode( ::rtl::OUString& rString ) const
switch( nCharCode )
{
case 13: // CR
- aResult += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%0D%0A") ); // CR LF in hex
+ aResult.append("%0D%0A"); // CR LF in hex
break;
@@ -989,7 +994,7 @@ void ODatabaseForm::Encode( ::rtl::OUString& rString ) const
case 46: // '.'
case 64: // '@'
case 95: // '_'
- aResult += UniString(nCharCode);
+ aResult.append(nCharCode);
break;
default:
@@ -999,21 +1004,18 @@ void ODatabaseForm::Encode( ::rtl::OUString& rString ) const
short nLo = ((sal_Int16)nCharCode) - (nHi*16);
if( nHi > 9 ) nHi += (int)'A'-10; else nHi += (int)'0';
if( nLo > 9 ) nLo += (int)'A'-10; else nLo += (int)'0';
- aResult += UniString('%');
- aResult += UniString((sal_Unicode)nHi);
- aResult += UniString((sal_Unicode)nLo);
+ aResult.append('%');
+ aResult.append((sal_Unicode)nHi);
+ aResult.append((sal_Unicode)nLo);
}
}
}
else
- aResult += UniString(nCharCode);
+ aResult.append(nCharCode);
}
-
// Replace spaces with '+'
- aResult = aResult.replace(' ', '+');
-
- rString = aResult;
+ rString = aResult.makeStringAndClear().replace(' ', '+');
}
//------------------------------------------------------------------------
@@ -1026,15 +1028,16 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const ::rtl::OUStr
// Header
- ::rtl::OUString aContentDisp (RTL_CONSTASCII_USTRINGPARAM("form-data; name=\"") );
- aContentDisp += rName;
- aContentDisp += UniString('\"');
- pChild->SetContentDisposition( aContentDisp );
+ ::rtl::OUStringBuffer aContentDisp;
+ aContentDisp.append("form-data; name=\"");
+ aContentDisp.append(rName);
+ aContentDisp.append('\"');
+ pChild->SetContentDisposition(aContentDisp.makeStringAndClear());
pChild->SetContentType(::rtl::OUString("text/plain"));
rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding();
const sal_Char* pBestMatchingEncoding = rtl_getBestMimeCharsetFromTextEncoding( eSystemEncoding );
- UniString aBestMatchingEncoding = UniString::CreateFromAscii( pBestMatchingEncoding );
+ rtl::OUString aBestMatchingEncoding = rtl::OUString::createFromAscii(pBestMatchingEncoding);
pChild->SetContentTransferEncoding(aBestMatchingEncoding);
// Body
@@ -1050,11 +1053,11 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const ::rtl::OUStr
sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::OUString& rName,
const ::rtl::OUString& rFileName )
{
- UniString aFileName( rFileName );
- UniString aContentType(UniString::CreateFromAscii(CONTENT_TYPE_STR_TEXT_PLAIN));
+ rtl::OUString aFileName(rFileName);
+ rtl::OUString aContentType(CONTENT_TYPE_STR_TEXT_PLAIN);
SvStream *pStream = 0;
- if( aFileName.Len() )
+ if (!aFileName.isEmpty())
{
// We can only process File URLs yet
INetURLObject aURL;
@@ -1090,13 +1093,14 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O
// Header
- ::rtl::OUString aContentDisp (RTL_CONSTASCII_USTRINGPARAM( "form-data; name=\"") );
- aContentDisp += rName;
- aContentDisp += UniString('\"');
- aContentDisp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("; filename=\"") );
- aContentDisp += aFileName;
- aContentDisp += UniString('\"');
- pChild->SetContentDisposition( aContentDisp );
+ ::rtl::OUStringBuffer aContentDisp;
+ aContentDisp.append("form-data; name=\"");
+ aContentDisp.append(rName);
+ aContentDisp.append('\"');
+ aContentDisp.append("; filename=\"");
+ aContentDisp.append(aFileName);
+ aContentDisp.append('\"');
+ pChild->SetContentDisposition(aContentDisp.makeStringAndClear());
pChild->SetContentType( aContentType );
pChild->SetContentTransferEncoding(::rtl::OUString("8bit"));
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index c5988f7..c65f9b0 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -494,8 +494,8 @@ public:
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TYPE]);
}
- void SetContentTransferEncoding (const UniString& rEncoding);
- UniString GetContentTransferEncoding() const
+ void SetContentTransferEncoding (const rtl::OUString& rEncoding);
+ rtl::OUString GetContentTransferEncoding() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
}
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 45bd0cb..6f9c9ee 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -1022,7 +1022,7 @@ void INetMIMEMessage::SetContentType (const String& rType)
}
void INetMIMEMessage::SetContentTransferEncoding (
- const String& rEncoding)
+ const rtl::OUString& rEncoding)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
commit 9b71aa0de186d534f4dc79b587f0cd6d8e17e590
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 15 09:03:57 2012 +0100
convert GetUndoActionComment family to rtl::OUString
Change-Id: I36ccf62ee2e2769bcf1aef6d26d96bce6c7078f0
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 7a6e758..a41fd7c 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1030,7 +1030,7 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const ::rtl::OUStr
aContentDisp += rName;
aContentDisp += UniString('\"');
pChild->SetContentDisposition( aContentDisp );
- pChild->SetContentType( UniString::CreateFromAscii("text/plain") );
+ pChild->SetContentType(::rtl::OUString("text/plain"));
rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding();
const sal_Char* pBestMatchingEncoding = rtl_getBestMimeCharsetFromTextEncoding( eSystemEncoding );
@@ -1098,7 +1098,7 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O
aContentDisp += UniString('\"');
pChild->SetContentDisposition( aContentDisp );
pChild->SetContentType( aContentType );
- pChild->SetContentTransferEncoding( UniString(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("8bit") ) ) );
+ pChild->SetContentTransferEncoding(::rtl::OUString("8bit"));
// Body
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 13de532..54c6488 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -475,7 +475,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
if ( aReturn.bEnabled )
{
// TODO: add "Undo/Redo: prefix"
- String ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const =
+ rtl::OUString ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const =
( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment;
aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, ::svl::IUndoManager::TopLevel );
}
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 843f4cf..3a0e5ed 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -553,9 +553,11 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
std::vector<String> &aList = aStrLst.GetList();
sal_Bool bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
size_t nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
- for (size_t i=0; i<nCount; i++)
- aList.push_back( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
- pUndoManager->GetRedoActionComment(i) );
+ for (size_t i=0; i<nCount; ++i)
+ {
+ aList.push_back( rtl::OUString( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
+ pUndoManager->GetRedoActionComment(i) ) );
+ }
}
rSet.Put( aStrLst );
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index fdbead9..bcc2f2a 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1062,9 +1062,8 @@ void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
{
// prepare list
::std::vector< String > aStringList;
- sal_uInt16 a;
- for( a = 0; a < nCount; a++)
+ for (sal_uInt16 a = 0; a < nCount; ++a)
{
// generate one String in list per undo step
aStringList.push_back( String(pUndoManager->GetUndoActionComment(a)) );
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 9d168b8..be84b14 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1290,7 +1290,7 @@ void SmDocShell::GetState(SfxItemSet &rSet)
::svl::IUndoManager* pTmpUndoMgr = GetUndoManager();
if( pTmpUndoMgr )
{
- UniString(::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
+ rtl::OUString(::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWh )
diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx
index a6b3fd6..58c620c 100644
--- a/svl/inc/svl/undo.hxx
+++ b/svl/inc/svl/undo.hxx
@@ -242,11 +242,11 @@ namespace svl
virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
virtual sal_uInt16 GetUndoActionId() const = 0;
- virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual rtl::OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0;
virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
- virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual rtl::OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
virtual sal_Bool Undo() = 0;
virtual sal_Bool Redo() = 0;
@@ -356,10 +356,10 @@ public:
virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False );
virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const;
virtual sal_uInt16 GetUndoActionId() const;
- virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual rtl::OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const;
virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const;
- virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual rtl::OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
virtual sal_Bool Undo();
virtual sal_Bool Redo();
virtual void Clear();
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 9183664..e27bf00 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -691,17 +691,15 @@ size_t SfxUndoManager::GetUndoActionCount( bool const i_currentLevel ) const
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentLevel ) const
+rtl::OUString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentLevel ) const
{
UndoManagerGuard aGuard( *m_pData );
- String sComment;
+ rtl::OUString sComment;
const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
DBG_ASSERT( nNo < pUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment: illegal index!" );
if( nNo < pUndoArray->nCurUndoAction )
- {
sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction - 1 - nNo ].pAction->GetComment();
- }
return sComment;
}
@@ -852,7 +850,7 @@ size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel )
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
+rtl::OUString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
{
UndoManagerGuard aGuard( *m_pData );
const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 4ce1e0a..431de8b 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -1471,7 +1471,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
{
if( pUndoManager )
{
- UniString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
+ rtl::OUString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 299294c..2bb6c5a 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -585,7 +585,7 @@ void SwDrawTextShell::StateUndo(SfxItemSet &rSet)
::svl::IUndoManager* pUndoManager = GetUndoManager();
if( pUndoManager )
{
- UniString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
+ rtl::OUString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
More information about the Libreoffice-commits
mailing list