summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:23:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:23:23 +0100
commitcf8b8cad053e0e9783cdc8f08ce886e2ae4b7eb0 (patch)
treeacb5e32f7abdb40975076487122c7fa1d05be0b7 /framework/source
parentfaf01b8d54737dfbb318709180966e84c7fd5614 (diff)
More loplugin:cstylecast: framework
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I8981ef6de675bf10c103e1af0afccd620762268d
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx4
-rw-r--r--framework/source/accelerators/keymapping.cxx2
-rw-r--r--framework/source/classes/framecontainer.cxx2
-rw-r--r--framework/source/dispatch/dispatchinformationprovider.cxx2
-rw-r--r--framework/source/fwe/classes/addonsoptions.cxx16
-rw-r--r--framework/source/fwe/helper/actiontriggerhelper.cxx2
-rw-r--r--framework/source/fwe/helper/propertysetcontainer.cxx6
-rw-r--r--framework/source/fwe/xml/statusbardocumenthandler.cxx6
-rw-r--r--framework/source/fwe/xml/toolboxdocumenthandler.cxx2
-rw-r--r--framework/source/fwi/uielement/itemcontainer.cxx2
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx2
-rw-r--r--framework/source/helper/ocomponentenumeration.cxx2
-rw-r--r--framework/source/helper/titlebarupdate.cxx2
-rw-r--r--framework/source/helper/vclstatusindicator.cxx2
-rw-r--r--framework/source/loadenv/loadenv.cxx6
-rw-r--r--framework/source/recording/dispatchrecorder.cxx8
-rw-r--r--framework/source/services/autorecovery.cxx6
-rw-r--r--framework/source/services/frame.cxx4
-rw-r--r--framework/source/services/pathsettings.cxx2
-rw-r--r--framework/source/services/substitutepathvars.cxx6
-rw-r--r--framework/source/services/urltransformer.cxx2
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx4
-rw-r--r--framework/source/uielement/buttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarmanager.cxx2
-rw-r--r--framework/source/uifactory/addonstoolbarfactory.cxx4
-rw-r--r--framework/source/xml/imagesdocumenthandler.cxx2
27 files changed, 51 insertions, 51 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index ecc33938ab75..08aa8b548bf3 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -177,7 +177,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XMLBasedAcceleratorConfiguration::g
throw css::lang::IllegalArgumentException(
"Empty command strings are not allowed here.",
static_cast< ::cppu::OWeakObject* >(this),
- (sal_Int16)i);
+ static_cast<sal_Int16>(i));
if (!rCache.hasCommand(rCommand))
continue;
@@ -714,7 +714,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g
throw css::lang::IllegalArgumentException(
"Empty command strings are not allowed here.",
static_cast< ::cppu::OWeakObject* >(this),
- (sal_Int16)i);
+ static_cast<sal_Int16>(i));
if (!rCache.hasCommand(rCommand))
continue;
diff --git a/framework/source/accelerators/keymapping.cxx b/framework/source/accelerators/keymapping.cxx
index 22bee0d2ce88..8b1bc1307b17 100644
--- a/framework/source/accelerators/keymapping.cxx
+++ b/framework/source/accelerators/keymapping.cxx
@@ -197,7 +197,7 @@ bool KeyMapping::impl_st_interpretIdentifierAsPureKeyCode(const OUString& sIdent
sal_Int32 nCode = sIdentifier.toInt32();
if (nCode > 0)
{
- rCode = (sal_uInt16)nCode;
+ rCode = static_cast<sal_uInt16>(nCode);
return true;
}
diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx
index b8a16dc05fe7..a8b028e57822 100644
--- a/framework/source/classes/framecontainer.cxx
+++ b/framework/source/classes/framecontainer.cxx
@@ -141,7 +141,7 @@ void FrameContainer::clear()
sal_uInt32 FrameContainer::getCount() const
{
SolarMutexGuard g;
- return( (sal_uInt32)m_aContainer.size() );
+ return static_cast<sal_uInt32>(m_aContainer.size());
}
/**-***************************************************************************************************************
diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx
index dc0f8e3850cc..ea0b05cf99ec 100644
--- a/framework/source/dispatch/dispatchinformationprovider.cxx
+++ b/framework/source/dispatch/dispatchinformationprovider.cxx
@@ -105,7 +105,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati
{ continue; }
}
- c1 = (sal_Int32)lInfos.size();
+ c1 = static_cast<sal_Int32>(lInfos.size());
i1 = 0;
css::uno::Sequence< css::frame::DispatchInformation > lReturn(c1);
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 3017197b7b16..9faacbc73d6c 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -306,8 +306,8 @@ void AddonsOptions_Impl::ImageEntry::addImage(ImageSize eSize,
const Image &rImage,
const OUString &rURL)
{
- aSizeEntry[(int)eSize].aImage = rImage;
- aSizeEntry[(int)eSize].aURL = rURL;
+ aSizeEntry[static_cast<int>(eSize)].aImage = rImage;
+ aSizeEntry[static_cast<int>(eSize)].aURL = rURL;
}
// constructor
@@ -494,7 +494,7 @@ Image AddonsOptions_Impl::GetImageFromURL( const OUString& aURL, bool bBig, bool
if ( pIter != m_aImageManager.end() )
{
ImageSize eSize = bBig ? IMGSIZE_BIG : IMGSIZE_SMALL;
- int nIdx = (int)eSize;
+ int nIdx = static_cast<int>(eSize);
int nOtherIdx = nIdx ? 0 : 1;
OneImageEntry& rSizeEntry = pIter->second.aSizeEntry[nIdx];
@@ -701,7 +701,7 @@ bool AddonsOptions_Impl::ReadToolBarItemSet( const OUString& rToolBarItemSetNode
}
}
- return ( (sal_uInt32)rAddonOfficeToolBarSeq.getLength() > nToolBarItemCount );
+ return ( static_cast<sal_uInt32>(rAddonOfficeToolBarSeq.getLength()) > nToolBarItemCount );
}
void AddonsOptions_Impl::ReadImages( ImageManager& aImageManager )
@@ -836,7 +836,7 @@ void AddonsOptions_Impl::ReadMergeMenuData( const OUString& aMergeAddonInstructi
aMergeMenuBaseNode += m_aPathDelimiter;
// extend the node names to have full path strings
- for ( sal_uInt32 i = 0; i < (sal_uInt32)aSubMenuNodeNames.getLength(); i++ )
+ for ( sal_uInt32 i = 0; i < static_cast<sal_uInt32>(aSubMenuNodeNames.getLength()); i++ )
aSubMenuNodeNames[i] = aMergeMenuBaseNode + aSubMenuNodeNames[i];
ReadSubMenuEntries( aSubMenuNodeNames, rMergeMenu );
@@ -1016,7 +1016,7 @@ bool AddonsOptions_Impl::ReadMergeStatusbarData(
}
}
- return ( (sal_uInt32)rMergeStatusbarItems.getLength() > nStatusbarItemCount );
+ return ( static_cast<sal_uInt32>(rMergeStatusbarItems.getLength()) > nStatusbarItemCount );
}
bool AddonsOptions_Impl::ReadStatusBarItem(
@@ -1084,7 +1084,7 @@ bool AddonsOptions_Impl::ReadMenuItem( const OUString& aMenuNodeName, Sequence<
// Continue to read the sub menu nodes
Sequence< Sequence< PropertyValue > > aSubMenuSeq;
OUString aSubMenuRootNodeName( aRootSubMenuName + m_aPathDelimiter );
- for ( sal_uInt32 n = 0; n < (sal_uInt32)aRootSubMenuNodeNames.getLength(); n++ )
+ for ( sal_uInt32 n = 0; n < static_cast<sal_uInt32>(aRootSubMenuNodeNames.getLength()); n++ )
aRootSubMenuNodeNames[n] = aSubMenuRootNodeName + aRootSubMenuNodeNames[n];
ReadSubMenuEntries( aRootSubMenuNodeNames, aSubMenuSeq );
aMenuItem[ OFFSET_MENUITEM_SUBMENU ].Value <<= aSubMenuSeq;
@@ -1149,7 +1149,7 @@ bool AddonsOptions_Impl::ReadPopupMenu( const OUString& aPopupMenuNodeName, Sequ
// Continue to read the sub menu nodes
Sequence< Sequence< PropertyValue > > aSubMenuSeq;
OUString aSubMenuRootNodeName( aRootSubMenuName + m_aPathDelimiter );
- for ( sal_uInt32 n = 0; n < (sal_uInt32)aRootSubMenuNodeNames.getLength(); n++ )
+ for ( sal_uInt32 n = 0; n < static_cast<sal_uInt32>(aRootSubMenuNodeNames.getLength()); n++ )
aRootSubMenuNodeNames[n] = aSubMenuRootNodeName + aRootSubMenuNodeNames[n];
ReadSubMenuEntries( aRootSubMenuNodeNames, aSubMenuSeq );
aPopupMenu[ OFFSET_POPUPMENU_SUBMENU ].Value <<= aSubMenuSeq;
diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx
index 9e9457ce80f5..ce06efdaef58 100644
--- a/framework/source/fwe/helper/actiontriggerhelper.cxx
+++ b/framework/source/fwe/helper/actiontriggerhelper.cxx
@@ -137,7 +137,7 @@ void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, const Reference< X
// command url but uses the item id as a unique identifier. These entries
// got a special url during conversion from menu=>actiontriggercontainer.
// Now we have to extract this special url and set the correct item id!!!
- nNewItemId = (sal_uInt16)aCommandURL.copy( nIndex+aSlotURL.getLength() ).toInt32();
+ nNewItemId = static_cast<sal_uInt16>(aCommandURL.copy( nIndex+aSlotURL.getLength() ).toInt32());
pSubMenu->InsertItem( nNewItemId, aLabel );
}
else
diff --git a/framework/source/fwe/helper/propertysetcontainer.cxx b/framework/source/fwe/helper/propertysetcontainer.cxx
index 788a5e589801..5d129d36b01a 100644
--- a/framework/source/fwe/helper/propertysetcontainer.cxx
+++ b/framework/source/fwe/helper/propertysetcontainer.cxx
@@ -105,7 +105,7 @@ void SAL_CALL PropertySetContainer::removeByIndex( sal_Int32 nIndex )
{
SolarMutexGuard g;
- if ( (sal_Int32)m_aPropertySetVector.size() <= nIndex )
+ if ( static_cast<sal_Int32>(m_aPropertySetVector.size()) <= nIndex )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
m_aPropertySetVector.erase(m_aPropertySetVector.begin() + nIndex);
@@ -114,7 +114,7 @@ void SAL_CALL PropertySetContainer::removeByIndex( sal_Int32 nIndex )
// XIndexReplace
void SAL_CALL PropertySetContainer::replaceByIndex( sal_Int32 Index, const css::uno::Any& Element )
{
- if ( (sal_Int32)m_aPropertySetVector.size() <= Index )
+ if ( static_cast<sal_Int32>(m_aPropertySetVector.size()) <= Index )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
Reference< XPropertySet > aPropertySetElement;
@@ -141,7 +141,7 @@ Any SAL_CALL PropertySetContainer::getByIndex( sal_Int32 Index )
{
SolarMutexGuard g;
- if ( (sal_Int32)m_aPropertySetVector.size() <= Index )
+ if ( static_cast<sal_Int32>(m_aPropertySetVector.size()) <= Index )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
return Any(m_aPropertySetVector[ Index ]);
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index b50ae541474f..82a8d131b0d9 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -148,7 +148,7 @@ OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
m_aStatusBarItems( rStatusBarItems )
{
// create hash map
- for ( int i = 0; i < (int)SB_XML_ENTRY_COUNT; i++ )
+ for ( int i = 0; i < int(SB_XML_ENTRY_COUNT); i++ )
{
if ( StatusBarEntries[i].nNamespace == SB_NS_STATUSBAR )
{
@@ -334,13 +334,13 @@ void SAL_CALL OReadStatusBarDocumentHandler::startElement(
case SB_ATTRIBUTE_WIDTH:
{
- nWidth = (sal_Int16)(xAttribs->getValueByIndex( n ).toInt32());
+ nWidth = static_cast<sal_Int16>(xAttribs->getValueByIndex( n ).toInt32());
}
break;
case SB_ATTRIBUTE_OFFSET:
{
- nOffset = (sal_Int16)(xAttribs->getValueByIndex( n ).toInt32());
+ nOffset = static_cast<sal_Int16>(xAttribs->getValueByIndex( n ).toInt32());
}
break;
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index eb59a9faacbc..76723286f0bf 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -128,7 +128,7 @@ OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XInde
m_aCommandURL( ITEM_DESCRIPTOR_COMMANDURL )
{
// create hash map
- for ( int i = 0; i < (int)TB_XML_ENTRY_COUNT; i++ )
+ for ( int i = 0; i < int(TB_XML_ENTRY_COUNT); i++ )
{
if ( ToolBoxEntries[i].nNamespace == TB_NS_TOOLBAR )
{
diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx
index ba9e78128619..50f8b5a8bd25 100644
--- a/framework/source/fwi/uielement/itemcontainer.cxx
+++ b/framework/source/fwi/uielement/itemcontainer.cxx
@@ -196,7 +196,7 @@ void SAL_CALL ItemContainer::insertByIndex( sal_Int32 Index, const Any& aItem )
void SAL_CALL ItemContainer::removeByIndex( sal_Int32 nIndex )
{
ShareGuard aLock( m_aShareMutex );
- if ( (sal_Int32)m_aItemVector.size() <= nIndex )
+ if ( static_cast<sal_Int32>(m_aItemVector.size()) <= nIndex )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
m_aItemVector.erase(m_aItemVector.begin() + nIndex);
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index ee6e078ed3d9..94672302cbda 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -211,7 +211,7 @@ void SAL_CALL RootItemContainer::insertByIndex( sal_Int32 Index, const Any& aIte
void SAL_CALL RootItemContainer::removeByIndex( sal_Int32 nIndex )
{
ShareGuard aLock( m_aShareMutex );
- if ( (sal_Int32)m_aItemVector.size() <= nIndex )
+ if ( static_cast<sal_Int32>(m_aItemVector.size()) <= nIndex )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
m_aItemVector.erase(m_aItemVector.begin() + nIndex);
diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx
index 5c964d62f727..de57e8669114 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -66,7 +66,7 @@ sal_Bool SAL_CALL OComponentEnumeration::hasMoreElements()
// => The last one is getLength() - 1!
// m_nPosition's current value is the position for the next element, which will be return, if user call "nextElement()"
// => We have more elements if current position less then the length of the list!
- return ( m_nPosition < (sal_uInt32)(m_seqComponents.size()) );
+ return ( m_nPosition < static_cast<sal_uInt32>(m_seqComponents.size()) );
}
// XEnumeration
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index f8d15ecca3e4..613d759e9d5f 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -282,7 +282,7 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra
if ( pWindow && ( pWindow->GetType() == WindowType::WORKWINDOW ) )
{
WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get());
- pWorkWindow->SetIcon( (sal_uInt16)nIcon );
+ pWorkWindow->SetIcon( static_cast<sal_uInt16>(nIcon) );
css::uno::Reference< css::frame::XModel > xModel = xController->getModel();
OUString aURL;
diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx
index d8594c60c53e..c2eb170bcc8f 100644
--- a/framework/source/helper/vclstatusindicator.cxx
+++ b/framework/source/helper/vclstatusindicator.cxx
@@ -115,7 +115,7 @@ void SAL_CALL VCLStatusIndicator::setValue(sal_Int32 nValue)
// normalize value to fit the range of 0-100%
sal_uInt16 nPercent = sal::static_int_cast< sal_uInt16 >(
::std::min(
- ((nValue*100) / ::std::max(nRange,(sal_Int32)1)), (sal_Int32)100));
+ ((nValue*100) / ::std::max(nRange,sal_Int32(1))), sal_Int32(100)));
if (m_pStatusBar)
m_pStatusBar->SetProgressValue(nPercent);
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index e0e8ab53610d..6fd8f5b54061 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -805,7 +805,7 @@ void LoadEnv::impl_detectTypeAndFilter()
try
{
::comphelper::SequenceAsHashMap lFilterProps(xFilterCont->getByName(sFilter));
- sal_Int32 nFlags = lFilterProps.getUnpackedValueOrDefault("Flags", (sal_Int32)0);
+ sal_Int32 nFlags = lFilterProps.getUnpackedValueOrDefault("Flags", sal_Int32(0));
bIsOwnTemplate = ((nFlags & FILTERFLAG_TEMPLATEPATH) == FILTERFLAG_TEMPLATEPATH);
}
catch(const css::container::NoSuchElementException&)
@@ -1249,7 +1249,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// Note: To detect if a document was already loaded before
// we check URLs here only. But might the existing and the required
// document has different versions! Then its URLs are the same ...
- sal_Int16 nNewVersion = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_VERSION(), (sal_Int16)-1);
+ sal_Int16 nNewVersion = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_VERSION(), sal_Int16(-1));
// will be used to save the first hidden frame referring the searched model
// Normally we are interested on visible frames ... but if there is no such visible
@@ -1298,7 +1298,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// or must not have any file revision set (-1 == -1!)
utl::MediaDescriptor lOldDocDescriptor(xModel->getArgs());
- if (lOldDocDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_VERSION(), (sal_Int32)-1) != nNewVersion)
+ if (lOldDocDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_VERSION(), sal_Int32(-1)) != nNewVersion)
{
xTask.clear ();
continue;
diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx
index 5832f55d3f0c..62de449cef3c 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -224,7 +224,7 @@ void DispatchRecorder::AppendToBuffer( const css::uno::Any& aValue, OUStringBuff
// add the character constant
aArgumentBuffer.append("CHR$(");
- aArgumentBuffer.append( (sal_Int32) pChars[nChar] );
+ aArgumentBuffer.append( static_cast<sal_Int32>(pChars[nChar]) );
aArgumentBuffer.append(")");
}
else
@@ -347,7 +347,7 @@ void DispatchRecorder::implts_recordMacro( const OUString& aURL,
aScriptBuffer.append("dim ");
aScriptBuffer.append (sArrayName);
aScriptBuffer.append("(");
- aScriptBuffer.append ((sal_Int32)(nValidArgs-1)); // 0 based!
+ aScriptBuffer.append (static_cast<sal_Int32>(nValidArgs-1)); // 0 based!
aScriptBuffer.append(") as new com.sun.star.beans.PropertyValue\n");
aScriptBuffer.append (aArgumentBuffer.makeStringAndClear());
aScriptBuffer.append("\n");
@@ -390,7 +390,7 @@ sal_Int32 SAL_CALL DispatchRecorder::getCount()
css::uno::Any SAL_CALL DispatchRecorder::getByIndex(sal_Int32 idx)
{
- if (idx >= (sal_Int32)m_aStatements.size()) {
+ if (idx >= static_cast<sal_Int32>(m_aStatements.size())) {
throw css::lang::IndexOutOfBoundsException( "Dispatch recorder out of bounds" );
}
@@ -409,7 +409,7 @@ void SAL_CALL DispatchRecorder::replaceByIndex(sal_Int32 idx, const css::uno::An
Reference< XInterface >(), 2 );
}
- if (idx >= (sal_Int32)m_aStatements.size()) {
+ if (idx >= static_cast<sal_Int32>(m_aStatements.size())) {
throw css::lang::IndexOutOfBoundsException(
"Dispatch recorder out of bounds" );
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index ed66677e1b22..8ba3e8487bad 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -1185,7 +1185,7 @@ DispatchParams::DispatchParams()
DispatchParams::DispatchParams(const ::comphelper::SequenceAsHashMap& lArgs ,
const css::uno::Reference< css::uno::XInterface >& xOwner)
{
- m_nWorkingEntryID = lArgs.getUnpackedValueOrDefault(PROP_ENTRY_ID, (sal_Int32)-1 );
+ m_nWorkingEntryID = lArgs.getUnpackedValueOrDefault(PROP_ENTRY_ID, sal_Int32(-1) );
m_xProgress = lArgs.getUnpackedValueOrDefault(PROP_PROGRESS, css::uno::Reference< css::task::XStatusIndicator >());
m_sSavePath = lArgs.getUnpackedValueOrDefault(PROP_SAVEPATH, OUString() );
m_xHoldRefForAsyncOpAlive = xOwner;
@@ -2007,7 +2007,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn
OUStringBuffer sIDBuf;
sIDBuf.append(RECOVERY_ITEM_BASE_IDENTIFIER);
- sIDBuf.append((sal_Int32)rInfo.ID);
+ sIDBuf.append(static_cast<sal_Int32>(rInfo.ID));
OUString sID = sIDBuf.makeStringAndClear();
// remove
@@ -4074,7 +4074,7 @@ bool AutoRecovery::impl_enoughDiscSpace(sal_Int32 nRequiredSpace)
}
sal_uInt64 nFreeMB = (nFreeSpace/1048576);
- return (nFreeMB >= (sal_uInt64)nRequiredSpace);
+ return (nFreeMB >= static_cast<sal_uInt64>(nRequiredSpace));
#endif // SIMULATE_FULL_DISC
}
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 4366c26b0944..2f2011d60364 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1970,7 +1970,7 @@ css::uno::Sequence< css::beans::Property > SAL_CALL Frame::getProperties()
SolarMutexGuard g;
- sal_Int32 c = (sal_Int32)m_lProps.size();
+ sal_Int32 c = static_cast<sal_Int32>(m_lProps.size());
css::uno::Sequence< css::beans::Property > lProps(c);
TPropInfoHash::const_iterator pIt;
@@ -3048,7 +3048,7 @@ void Frame::implts_setIconOnWindow()
)
{
WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get());
- pWorkWindow->SetIcon( (sal_uInt16)nIcon );
+ pWorkWindow->SetIcon( static_cast<sal_uInt16>(nIcon) );
}
}
/* UNSAFE AREA --------------------------------------------------------------------------------------------- */
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index c16a5b1e95cd..ed73a08fae41 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -1076,7 +1076,7 @@ void PathSettings::impl_rebuildPropertyDescriptor()
// SAFE ->
osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
- sal_Int32 c = (sal_Int32)m_lPaths.size();
+ sal_Int32 c = static_cast<sal_Int32>(m_lPaths.size());
sal_Int32 i = 0;
m_lPropDesc.realloc(c*IDGROUP_COUNT);
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 72bcfb940b69..b41660242210 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -216,7 +216,7 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XComponentCon
// Example: WORK_PATH=c:\test, $(workdirurl)=WORK_PATH => WORK_PATH=$(workdirurl) and this cannot be substituted!
ReSubstFixedVarOrder aFixedVar;
aFixedVar.eVariable = PreDefVariable(i);
- aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength();
+ aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[static_cast<sal_Int32>(aFixedVar.eVariable)].getLength();
m_aReSubstFixedVarOrder.push_back( aFixedVar );
}
}
@@ -594,7 +594,7 @@ OUString const & SubstitutePathVariables::impl_getSubstituteVariableValue( const
throw NoSuchElementException("Unknown variable!", static_cast<cppu::OWeakObject *>(this));
}
PreDefVariable nIndex = pNTOIIter->second;
- return m_aPreDefVars.m_FixedVar[(sal_Int32)nIndex];
+ return m_aPreDefVars.m_FixedVar[static_cast<sal_Int32>(nIndex)];
}
void SubstitutePathVariables::SetPredefinedPathVariables()
@@ -666,7 +666,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables()
m_aPreDefVars.m_FixedVar[ PREDEFVAR_VLANG ] = aLocaleStr;
// Set $(langid)
- m_aPreDefVars.m_FixedVar[ PREDEFVAR_LANGID ] = OUString::number( (sal_uInt16)m_aPreDefVars.m_eLanguageType );
+ m_aPreDefVars.m_FixedVar[ PREDEFVAR_LANGID ] = OUString::number( static_cast<sal_uInt16>(m_aPreDefVars.m_eLanguageType) );
// Set the other pre defined path variables
// Set $(work)
diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx
index 493acda1fa4c..dec58037d19f 100644
--- a/framework/source/services/urltransformer.cxx
+++ b/framework/source/services/urltransformer.cxx
@@ -70,7 +70,7 @@ namespace
_rURL.User = _rParser.GetUser ( INetURLObject::DecodeMechanism::WithCharset );
_rURL.Password = _rParser.GetPass ( INetURLObject::DecodeMechanism::WithCharset );
_rURL.Server = _rParser.GetHost ( INetURLObject::DecodeMechanism::WithCharset );
- _rURL.Port = (sal_Int16)_rParser.GetPort();
+ _rURL.Port = static_cast<sal_Int16>(_rParser.GetPort());
sal_Int32 nCount = _rParser.getSegmentCount( false );
if ( nCount > 0 )
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 4e4104f1e003..14ea5039035e 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -218,7 +218,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
sal_uInt32 nElements( 0 );
bool bAppendSeparator( false );
Reference< XWindow > xToolbarWindow = VCLUnoHelper::GetInterface( m_pToolBar );
- for ( sal_uInt32 n = 0; n < (sal_uInt32)rAddonToolbar.getLength(); n++ )
+ for ( sal_uInt32 n = 0; n < static_cast<sal_uInt32>(rAddonToolbar.getLength()); n++ )
{
OUString aURL;
OUString aTitle;
@@ -409,7 +409,7 @@ IMPL_LINK_NOARG(AddonsToolBarManager, Select, ToolBox *, void)
if ( m_bDisposed )
return;
- sal_Int16 nKeyModifier( (sal_Int16)m_pToolBar->GetModifier() );
+ sal_Int16 nKeyModifier( static_cast<sal_Int16>(m_pToolBar->GetModifier()) );
sal_uInt16 nId( m_pToolBar->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
if ( pIter != m_aControllerMap.end() )
diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx
index 9283da1ccca1..858182da882a 100644
--- a/framework/source/uielement/buttontoolbarcontroller.cxx
+++ b/framework/source/uielement/buttontoolbarcontroller.cxx
@@ -261,7 +261,7 @@ void SAL_CALL ButtonToolbarController::click()
if ( m_bDisposed )
throw DisposedException();
- sal_Int16 nKeyModifier( (sal_Int16)m_pToolbar->GetModifier() );
+ sal_Int16 nKeyModifier( static_cast<sal_Int16>(m_pToolbar->GetModifier()) );
execute( nKeyModifier );
}
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 2245cc35696e..d9020d97fc4f 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -95,7 +95,7 @@ void FontMenuController::fillPopupMenu( const Sequence< OUString >& rFontNameSeq
sort(aVector.begin(), aVector.end(), lcl_I18nCompareString );
const OUString aFontNameCommandPrefix( ".uno:CharFontName?CharFontName.FamilyName:string=" );
- const sal_Int16 nCount = (sal_Int16)aVector.size();
+ const sal_Int16 nCount = static_cast<sal_Int16>(aVector.size());
for ( sal_Int16 i = 0; i < nCount; i++ )
{
const OUString& rName = aVector[i];
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 5c69e7f0dac8..44596aec8a34 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1769,7 +1769,7 @@ IMPL_LINK_NOARG(ToolBarManager, Select, ToolBox *, void)
if ( m_bDisposed )
return;
- sal_Int16 nKeyModifier( (sal_Int16)m_pToolBar->GetModifier() );
+ sal_Int16 nKeyModifier( static_cast<sal_Int16>(m_pToolBar->GetModifier()) );
sal_uInt16 nId( m_pToolBar->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
diff --git a/framework/source/uifactory/addonstoolbarfactory.cxx b/framework/source/uifactory/addonstoolbarfactory.cxx
index fd0106bfc2e4..4f97fa4ebcb8 100644
--- a/framework/source/uifactory/addonstoolbarfactory.cxx
+++ b/framework/source/uifactory/addonstoolbarfactory.cxx
@@ -119,14 +119,14 @@ bool AddonsToolBarFactory::hasButtonsInContext(
// Check before we create a toolbar that we have at least one button in
// the current frame context.
- for ( sal_uInt32 i = 0; i < (sal_uInt32)rPropSeqSeq.getLength(); i++ )
+ for ( sal_uInt32 i = 0; i < static_cast<sal_uInt32>(rPropSeqSeq.getLength()); i++ )
{
bool bIsButton( true );
bool bIsCorrectContext( false );
sal_uInt32 nPropChecked( 0 );
const Sequence< PropertyValue >& rPropSeq = rPropSeqSeq[i];
- for ( sal_uInt32 j = 0; j < (sal_uInt32)rPropSeq.getLength(); j++ )
+ for ( sal_uInt32 j = 0; j < static_cast<sal_uInt32>(rPropSeq.getLength()); j++ )
{
if ( rPropSeq[j].Name == "Context" )
{
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index fd0d51f9b6e8..cbb6bc4ff78b 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -112,7 +112,7 @@ OReadImagesDocumentHandler::OReadImagesDocumentHandler( ImageListsDescriptor& aI
m_nHashMaskModeColor = OUString( ATTRIBUTE_MASKMODE_COLOR ).hashCode();
// create hash map to speed up lookup
- for ( int i = 0; i < (int)IMG_XML_ENTRY_COUNT; i++ )
+ for ( int i = 0; i < int(IMG_XML_ENTRY_COUNT); i++ )
{
OUStringBuffer temp( 20 );