[Libreoffice-commits] .: 2 commits - uui/source vcl/Library_vcl.mk vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Mon May 7 00:21:36 PDT 2012
uui/source/alreadyopen.cxx | 10 +++++-----
uui/source/filechanged.cxx | 8 ++++----
uui/source/iahndl-locking.cxx | 18 ++++++++----------
uui/source/iahndl.cxx | 4 ++--
uui/source/lockfailed.cxx | 6 +++---
uui/source/nameclashdlg.cxx | 6 +++---
uui/source/openlocked.cxx | 6 +++---
uui/source/passworddlg.cxx | 12 ++++++------
uui/source/trylater.cxx | 6 +++---
vcl/Library_vcl.mk | 7 +++++++
vcl/source/gdi/bitmap2.cxx | 20 ++++++++++++++++++++
vcl/unx/generic/gdi/salbmp.cxx | 15 +++++++++------
12 files changed, 73 insertions(+), 45 deletions(-)
New commits:
commit 535e9e7f7d2ddf312a2b77350e94606584778709
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun May 6 23:28:17 2012 +0100
tidy ResId String/rtl::OUString cast foo
Change-Id: I1e8fca182a27efb403e903b424ca4c1c0d3acc49
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx
index fbe6a7f..3d9a726 100644
--- a/uui/source/alreadyopen.cxx
+++ b/uui/source/alreadyopen.cxx
@@ -31,23 +31,23 @@
AlreadyOpenQueryBox::AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage, sal_Bool bIsStoring ) :
MessBox(pParent, 0,
- String( ResId( STR_ALREADYOPEN_TITLE, *pResMgr ) ),
+ ResId(STR_ALREADYOPEN_TITLE, *pResMgr).toString(),
aMessage )
{
SetImage( QueryBox::GetStandardImage() );
if ( bIsStoring )
{
- AddButton( String( ResId( STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr ) ), RET_YES,
+ AddButton( ResId(STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( String( ResId( STR_ALREADYOPEN_SAVE_BTN, *pResMgr ) ), RET_NO, 0 );
+ AddButton( ResId(STR_ALREADYOPEN_SAVE_BTN, *pResMgr).toString(), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
}
else
{
- AddButton( String( ResId( STR_ALREADYOPEN_READONLY_BTN, *pResMgr ) ), RET_YES,
+ AddButton( ResId(STR_ALREADYOPEN_READONLY_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( String( ResId( STR_ALREADYOPEN_OPEN_BTN, *pResMgr ) ), RET_NO, 0 );
+ AddButton( ResId(STR_ALREADYOPEN_OPEN_BTN, *pResMgr).toString(), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
}
diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx
index 0a41fa8..c926d94 100644
--- a/uui/source/filechanged.cxx
+++ b/uui/source/filechanged.cxx
@@ -31,17 +31,17 @@
FileChangedQueryBox::FileChangedQueryBox( Window* pParent, ResMgr* pResMgr ) :
MessBox(pParent, 0,
- String( ResId( STR_FILECHANGED_TITLE, *pResMgr ) ),
+ ResId(STR_FILECHANGED_TITLE, *pResMgr).toString(),
String::EmptyString() )
{
SetImage( QueryBox::GetStandardImage() );
- AddButton( String( ResId( STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr ) ), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton(ResId(STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr).toString(), RET_YES,
+ BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, String::EmptyString() );
- SetMessText( String( ResId( STR_FILECHANGED_MSG, *pResMgr ) ) );
+ SetMessText(ResId(STR_FILECHANGED_MSG, *pResMgr).toString());
}
FileChangedQueryBox::~FileChangedQueryBox()
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index 5ed5c01..e7235e5 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -97,10 +97,9 @@ handleLockedDocumentRequest_(
{
aArguments.push_back( !aInfo.isEmpty()
? aInfo
- : ::rtl::OUString( String(
- ResId( STR_UNKNOWNUSER,
- *xManager.get() ) ) ) );
- aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) );
+ : ResId( STR_UNKNOWNUSER,
+ *xManager.get() ).toString() );
+ aMessage = ResId(STR_OPENLOCKED_MSG, *xManager.get()).toString();
aMessage = UUIInteractionHelper::replaceMessageWithArguments(
aMessage, aArguments );
@@ -112,10 +111,9 @@ handleLockedDocumentRequest_(
{
aArguments.push_back( !aInfo.isEmpty()
? aInfo
- : ::rtl::OUString( String(
- ResId( STR_UNKNOWNUSER,
- *xManager.get() ) ) ) );
- aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) );
+ : ResId( STR_UNKNOWNUSER,
+ *xManager.get() ).toString() );
+ aMessage = ResId(STR_TRYLATER_MSG, *xManager.get()).toString();
aMessage = UUIInteractionHelper::replaceMessageWithArguments(
aMessage, aArguments );
@@ -127,10 +125,10 @@ handleLockedDocumentRequest_(
nMode == UUI_DOC_OWN_SAVE_LOCK )
{
aArguments.push_back( aInfo );
- aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK
+ aMessage = ResId(nMode == UUI_DOC_OWN_SAVE_LOCK
? STR_ALREADYOPEN_SAVE_MSG
: STR_ALREADYOPEN_MSG,
- *xManager.get() ) );
+ *xManager.get() ).toString();
aMessage = UUIInteractionHelper::replaceMessageWithArguments(
aMessage, aArguments );
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 8816ea9..907b070 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1312,10 +1312,10 @@ UUIInteractionHelper::handleGenericErrorRequest(
rtl::OUString aTitle( utl::ConfigManager::getProductName() );
::rtl::OUString aErrTitle
- = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE
+ = ResId( nError == ERRCODE_SFX_BROKENSIGNATURE
? STR_WARNING_BROKENSIGNATURE_TITLE
: STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE,
- *xManager.get() ) );
+ *xManager.get() ).toString();
if ( !aTitle.isEmpty() && !aErrTitle.isEmpty() )
aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) );
diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx
index bc2e7c3..325eeac 100644
--- a/uui/source/lockfailed.cxx
+++ b/uui/source/lockfailed.cxx
@@ -33,7 +33,7 @@
LockFailedQueryBox::LockFailedQueryBox( Window* pParent, ResMgr* pResMgr ) :
MessBox(pParent, 0,
- String( ResId( STR_LOCKFAILED_TITLE, *pResMgr ) ),
+ ResId(STR_LOCKFAILED_TITLE, *pResMgr).toString(),
String::EmptyString() )
{
SetImage( ErrorBox::GetStandardImage() );
@@ -41,8 +41,8 @@ LockFailedQueryBox::LockFailedQueryBox( Window* pParent, ResMgr* pResMgr ) :
AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_OKBUTTON );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
- SetMessText( String( ResId( STR_LOCKFAILED_MSG, *pResMgr ) ) );
- SetCheckBoxText( String( ResId( STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr ) ) );
+ SetMessText(ResId(STR_LOCKFAILED_MSG, *pResMgr ).toString());
+ SetCheckBoxText(ResId(STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr).toString());
}
LockFailedQueryBox::~LockFailedQueryBox()
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
index f6beaf8..52357e4 100644
--- a/uui/source/nameclashdlg.cxx
+++ b/uui/source/nameclashdlg.cxx
@@ -83,11 +83,11 @@ NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr,
String aInfo;
if ( bAllowOverwrite )
{
- aInfo = String( ResId( STR_RENAME_OR_REPLACE, *pResMgr ) );
+ aInfo = ResId(STR_RENAME_OR_REPLACE, *pResMgr).toString();
}
else
{
- aInfo = String( ResId( STR_NAME_CLASH_RENAME_ONLY, *pResMgr ) );
+ aInfo = ResId(STR_NAME_CLASH_RENAME_ONLY, *pResMgr).toString();
maBtnOverwrite.Hide();
}
@@ -95,7 +95,7 @@ NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr,
if ( osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL( rTargetFolderURL, aPath ) )
aPath = rTargetFolderURL;
- maSameName = String ( ResId( STR_SAME_NAME_USED, *pResMgr ) );
+ maSameName = ResId(STR_SAME_NAME_USED, *pResMgr).toString();
aInfo.SearchAndReplaceAscii( "%NAME", rClashingName );
aInfo.SearchAndReplaceAscii( "%FOLDER", aPath );
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index 0c1d917..fc04f05 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -31,15 +31,15 @@
OpenLockedQueryBox::OpenLockedQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ) :
MessBox(pParent, 0,
- String( ResId( STR_OPENLOCKED_TITLE, *pResMgr ) ),
+ ResId(STR_OPENLOCKED_TITLE, *pResMgr).toString(),
aMessage )
{
SetImage( QueryBox::GetStandardImage() );
- AddButton( String( ResId( STR_OPENLOCKED_OPENREADONLY_BTN, *pResMgr ) ), RET_YES,
+ AddButton(ResId(STR_OPENLOCKED_OPENREADONLY_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- AddButton( String( ResId( STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr ) ), RET_NO, 0);
+ AddButton(ResId(STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr).toString(), RET_NO, 0);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, String() );
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 946e47e..e36f578 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -73,13 +73,13 @@ PasswordDialog::PasswordDialog(
{
const sal_uInt16 nOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
const sal_uInt16 nErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : nOpenToModifyErrStrId;
- String aErrorMsg( ResId( nErrStrId, *pResourceMgr ));
+ rtl::OUString aErrorMsg(ResId(nErrStrId, *pResourceMgr).toString());
ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
aErrorBox.Execute();
}
// default settings for enter password or reenter passwd...
- String aTitle( ResId( STR_TITLE_ENTER_PASSWORD, *pResourceMgr ) );
+ rtl::OUString aTitle(ResId(STR_TITLE_ENTER_PASSWORD, *pResourceMgr).toString());
aFTConfirmPassword.Hide();
aEDConfirmPassword.Hide();
aFTConfirmPassword.Enable( sal_False );
@@ -88,9 +88,9 @@ PasswordDialog::PasswordDialog(
// settings for create password
if (nDialogMode == task::PasswordRequestMode_PASSWORD_CREATE)
{
- aTitle = String( ResId( STR_TITLE_CREATE_PASSWORD, *pResourceMgr ) );
+ aTitle = ResId(STR_TITLE_CREATE_PASSWORD, *pResourceMgr).toString();
- aFTConfirmPassword.SetText( String( ResId( STR_CONFIRM_SIMPLE_PASSWORD, *pResourceMgr ) ) );
+ aFTConfirmPassword.SetText(ResId(STR_CONFIRM_SIMPLE_PASSWORD, *pResourceMgr).toString());
aFTConfirmPassword.Show();
aEDConfirmPassword.Show();
@@ -116,12 +116,12 @@ PasswordDialog::PasswordDialog(
SetText( aTitle );
sal_uInt16 nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN;
- aFTPassword.SetText( String( ResId( nStrId, *pResourceMgr ) ) );
+ aFTPassword.SetText(ResId(nStrId, *pResourceMgr).toString());
aFTPassword.SetText( aFTPassword.GetText() + aDocURL );
if (bIsSimplePasswordRequest)
{
DBG_ASSERT( aDocURL.isEmpty(), "A simple password request should not have a document URL! Use document password request instead." );
- aFTPassword.SetText( String( ResId( STR_ENTER_SIMPLE_PASSWORD, *pResourceMgr ) ) );
+ aFTPassword.SetText(ResId(STR_ENTER_SIMPLE_PASSWORD, *pResourceMgr).toString());
}
FreeResource();
diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx
index d8aaad2..69d9528 100644
--- a/uui/source/trylater.cxx
+++ b/uui/source/trylater.cxx
@@ -31,14 +31,14 @@
TryLaterQueryBox::TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ) :
MessBox(pParent, 0,
- String( ResId( STR_TRYLATER_TITLE, *pResMgr ) ),
+ ResId(STR_TRYLATER_TITLE, *pResMgr).toString(),
aMessage )
{
SetImage( QueryBox::GetStandardImage() );
- AddButton( String( ResId( STR_TRYLATER_RETRYSAVING_BTN, *pResMgr ) ), RET_YES,
+ AddButton(ResId(STR_TRYLATER_RETRYSAVING_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- AddButton( String( ResId( STR_TRYLATER_SAVEAS_BTN, *pResMgr ) ), RET_NO, 0);
+ AddButton(ResId(STR_TRYLATER_SAVEAS_BTN, *pResMgr).toString(), RET_NO, 0);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, String::EmptyString() );
commit 0672b7a929576f902c48058e712c7d1a5711ac64
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun May 6 22:36:15 2012 +0100
silence more valgrind spew on scanline-extended deadspace
Change-Id: I8607d9d405a3996699ef85564938628624987385
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 0898286..92e35a2 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -429,6 +429,13 @@ vcl_headless_code=\
vcl/headless/svptext \
vcl/headless/svpvd
+$(eval $(call gb_Library_add_defs,vcl,\
+ $(if $(VALGRIND_CFLAGS), \
+ $(VALGRIND_CFLAGS) \
+ -DHAVE_MEMCHECK_H=1 \
+ ) \
+))
+
ifeq ($(GUIBASE),unx)
$(eval $(call gb_Library_add_defs,vcl,\
-DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 90d407e..c559383 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -36,6 +36,10 @@
#include <utility>
+#if defined(HAVE_MEMCHECK_H)
+#include <memcheck.h>
+#endif
+
// -----------
// - Defines -
@@ -903,6 +907,18 @@ sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
+#if defined(HAVE_MEMCHECK_H)
+namespace
+{
+ void blankExtraSpace(sal_uInt8 *pBits, long nWidth, long nScanlineSize, int nBitCount)
+ {
+ size_t nExtraSpaceInScanLine = nScanlineSize - nWidth * nBitCount / 8;
+ if (nExtraSpaceInScanLine)
+ memset(pBits + (nScanlineSize - nExtraSpaceInScanLine), 0, nExtraSpaceInScanLine);
+ }
+}
+#endif
+
sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
sal_uLong nCompression, sal_uInt32& rImageSize )
{
@@ -975,6 +991,10 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
const long nWidth = rAcc.Width();
const long nHeight = rAcc.Height();
sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
+#if defined(HAVE_MEMCHECK_H)
+ if (RUNNING_ON_VALGRIND)
+ blankExtraSpace(pBuf, nWidth, nAlignedWidth, discretizeBitcount(nBitCount));
+#endif
sal_uInt8* pTmp;
sal_uInt8 cTmp;
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index d48cf98..e2f9e97 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -118,15 +118,18 @@ void X11SalBitmap::ImplRemovedFromCache()
}
#if defined(HAVE_MEMCHECK_H)
-void blankExtraSpace(BitmapBuffer* pDIB)
+namespace
{
- size_t nExtraSpaceInScanLine = pDIB->mnScanlineSize - pDIB->mnWidth * pDIB->mnBitCount / 8;
- if (nExtraSpaceInScanLine)
+ void blankExtraSpace(BitmapBuffer* pDIB)
{
- for (long i = 0; i < pDIB->mnHeight; ++i)
+ size_t nExtraSpaceInScanLine = pDIB->mnScanlineSize - pDIB->mnWidth * pDIB->mnBitCount / 8;
+ if (nExtraSpaceInScanLine)
{
- sal_uInt8 *pRow = pDIB->mpBits + (i * pDIB->mnScanlineSize);
- memset(pRow + (pDIB->mnScanlineSize - nExtraSpaceInScanLine), 0, nExtraSpaceInScanLine);
+ for (long i = 0; i < pDIB->mnHeight; ++i)
+ {
+ sal_uInt8 *pRow = pDIB->mpBits + (i * pDIB->mnScanlineSize);
+ memset(pRow + (pDIB->mnScanlineSize - nExtraSpaceInScanLine), 0, nExtraSpaceInScanLine);
+ }
}
}
}
More information about the Libreoffice-commits
mailing list