[Libreoffice-commits] core.git: filter/source framework/source hwpfilter/source include/filter sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Oct 31 12:29:29 UTC 2017
filter/source/msfilter/escherex.cxx | 7 +----
filter/source/msfilter/msdffimp.cxx | 32 +++++++++++---------------
framework/source/dispatch/closedispatcher.cxx | 4 +--
framework/source/inc/pattern/frame.hxx | 9 +------
framework/source/uielement/menubarmanager.cxx | 10 --------
hwpfilter/source/hwpfile.cxx | 4 +--
hwpfilter/source/hwpfile.h | 2 -
include/filter/msfilter/escherex.hxx | 2 -
include/filter/msfilter/msdffimp.hxx | 3 --
sw/source/filter/ww8/wrtw8esh.cxx | 4 +--
10 files changed, 28 insertions(+), 49 deletions(-)
New commits:
commit 7383ab517030db0c2d7bf4f393f38743fbcaba04
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Oct 31 09:47:39 2017 +0200
loplugin:constantparam in f*
Change-Id: I87145db3af6c3eb180cea6b4244f98b00205a306
Reviewed-on: https://gerrit.libreoffice.org/44095
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 5075c342bbd5..9a83f2697ea8 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -5315,15 +5315,12 @@ sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor )
return nColor;
}
-sal_uInt32 EscherEx::GetColor( const Color& rSOColor, bool bSwap )
+sal_uInt32 EscherEx::GetColor( const Color& rSOColor )
{
sal_uInt32 nColor = ( rSOColor.GetRed() << 16 );
nColor |= ( rSOColor.GetGreen() << 8 );
nColor |= rSOColor.GetBlue();
-
- if ( !bSwap )
- nColor = GetColor( nColor );
-
+ nColor = GetColor( nColor );
return nColor;
}
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index c4786ff88d86..b2208e978059 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -749,16 +749,16 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
if ( nN )
{
OUString aPropName( "EndShape" );
- SetPropValue( Any(aXShape), xPropSet, aPropName, true );
+ SetPropValue( Any(aXShape), xPropSet, aPropName );
aPropName = "EndGluePointIndex";
- SetPropValue( Any(nId), xPropSet, aPropName, true );
+ SetPropValue( Any(nId), xPropSet, aPropName );
}
else
{
OUString aPropName( "StartShape" );
- SetPropValue( Any(aXShape), xPropSet, aPropName, true );
+ SetPropValue( Any(aXShape), xPropSet, aPropName );
aPropName = "StartGluePointIndex";
- SetPropValue( Any(nId), xPropSet, aPropName, true );
+ SetPropValue( Any(nId), xPropSet, aPropName );
}
// Not sure what this is good for, repaint or broadcast of object change.
@@ -7266,23 +7266,19 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
}
bool SvxMSDffManager::SetPropValue( const uno::Any& rAny, const uno::Reference< css::beans::XPropertySet > & rXPropSet,
- const OUString& rPropName, bool bTestPropertyAvailability )
+ const OUString& rPropName )
{
- bool bRetValue = true;
- if ( bTestPropertyAvailability )
+ bool bRetValue = false;
+ try
+ {
+ uno::Reference< beans::XPropertySetInfo >
+ aXPropSetInfo( rXPropSet->getPropertySetInfo() );
+ if ( aXPropSetInfo.is() )
+ bRetValue = aXPropSetInfo->hasPropertyByName( rPropName );
+ }
+ catch( const uno::Exception& )
{
bRetValue = false;
- try
- {
- uno::Reference< beans::XPropertySetInfo >
- aXPropSetInfo( rXPropSet->getPropertySetInfo() );
- if ( aXPropSetInfo.is() )
- bRetValue = aXPropSetInfo->hasPropertyByName( rPropName );
- }
- catch( const uno::Exception& )
- {
- bRetValue = false;
- }
}
if ( bRetValue )
{
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 2d89836b3453..2055cdc5d517 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -465,7 +465,7 @@ bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Reference< c
size_t i = 0;
for (i=0; i<c; ++i)
{
- if (!fpf::closeIt(aCheck.m_lModelFrames[i], false))
+ if (!fpf::closeIt(aCheck.m_lModelFrames[i]))
return false;
}
}
@@ -502,7 +502,7 @@ bool CloseDispatcher::implts_closeFrame()
// don't deliver ownership; our "UI user" will try it again if it failed.
// OK - he will get an empty frame then. But normally an empty frame
// should be closeable always :-)
- if (!fpf::closeIt(xFrame, false))
+ if (!fpf::closeIt(xFrame))
return false;
{
diff --git a/framework/source/inc/pattern/frame.hxx b/framework/source/inc/pattern/frame.hxx
index 79d8dabe9c53..5a8a6c005d48 100644
--- a/framework/source/inc/pattern/frame.hxx
+++ b/framework/source/inc/pattern/frame.hxx
@@ -48,15 +48,10 @@ namespace framework{
@param xResource
the object, which should be closed here.
- @param bDelegateOwnership
- used at the XCloseable->close() method to define
- the right owner in case closing failed.
-
@return [bool]
sal_True if closing failed.
*/
-inline bool closeIt(const css::uno::Reference< css::uno::XInterface >& xResource ,
- bool bDelegateOwnership)
+inline bool closeIt(const css::uno::Reference< css::uno::XInterface >& xResource)
{
css::uno::Reference< css::util::XCloseable > xClose (xResource, css::uno::UNO_QUERY);
css::uno::Reference< css::lang::XComponent > xDispose(xResource, css::uno::UNO_QUERY);
@@ -64,7 +59,7 @@ inline bool closeIt(const css::uno::Reference< css::uno::XInterface >& xResource
try
{
if (xClose.is())
- xClose->close(bDelegateOwnership);
+ xClose->close(false/*bDelegateOwnership*/);
else
if (xDispose.is())
xDispose->dispose();
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index e47217a8faf1..3d336f00bf53 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -95,14 +95,6 @@ namespace framework
#define aCmdHelpMenu ".uno:HelpMenu"
#define aSpecialWindowCommand ".uno:WindowList"
-static sal_Int16 getImageTypeFromBools( bool bBig )
-{
- sal_Int16 n( 0 );
- if ( bBig )
- n |= css::ui::ImageType::SIZE_LARGE;
- return n;
-}
-
MenuBarManager::MenuBarManager(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
@@ -260,7 +252,7 @@ void SAL_CALL MenuBarManager::elementInserted( const css::ui::ConfigurationEvent
return;
sal_Int16 nImageType = sal_Int16();
- sal_Int16 nCurrentImageType = getImageTypeFromBools( false );
+ sal_Int16 nCurrentImageType = css::ui::ImageType::SIZE_LARGE;
if (( Event.aInfo >>= nImageType ) &&
( nImageType == nCurrentImageType ))
RequestImages();
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index a93e03f3023a..62006be23a34 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -232,12 +232,12 @@ void HWPFile::ParaListRead()
ReadParaList(plist);
}
-bool HWPFile::ReadParaList(std::vector < HWPPara* > &aplist, unsigned char flag)
+bool HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
{
std::unique_ptr<HWPPara> spNode( new HWPPara );
unsigned char tmp_etcflag;
unsigned char prev_etcflag = 0;
- while (spNode->Read(*this, flag))
+ while (spNode->Read(*this, 0))
{
if( !(spNode->etcflag & 0x04) ){
tmp_etcflag = spNode->etcflag;
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index cb6074c4f869..bfa6da1b97e6 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -161,7 +161,7 @@ class DLLEXPORT HWPFile
* Reads main paragraph list
*/
bool ReadParaList(std::vector<std::unique_ptr<HWPPara>> &aplist, unsigned char flag = 0);
- bool ReadParaList(std::vector<HWPPara*> &aplist, unsigned char flag = 0);
+ bool ReadParaList(std::vector<HWPPara*> &aplist);
/**
* Sets if the stream is compressed
*/
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx
index 28055688f974..80e2888211a6 100644
--- a/include/filter/msfilter/escherex.hxx
+++ b/include/filter/msfilter/escherex.hxx
@@ -1152,7 +1152,7 @@ public:
virtual void Commit( EscherPropertyContainer& rProps, const tools::Rectangle& rRect);
static sal_uInt32 GetColor( const sal_uInt32 nColor );
- static sal_uInt32 GetColor( const Color& rColor, bool bSwap );
+ static sal_uInt32 GetColor( const Color& rColor );
// ...Sdr... implemented in eschesdo.cxx
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index ea6b6d6447a1..51cda16f4749 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -711,8 +711,7 @@ public:
static bool SetPropValue(
const css::uno::Any& rAny,
const css::uno::Reference< css::beans::XPropertySet > & rXPropSet,
- const OUString& rPropertyName,
- bool bTestPropertyAvailability
+ const OUString& rPropertyName
);
void insertShapeId( sal_Int32 nShapeId, SdrObject* pShape );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index e9fa1a83af68..c8a4b7677d3e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1892,7 +1892,7 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
}
else
{
- sal_uInt32 nFillColor = GetColor(rBrush.GetColor(), false);
+ sal_uInt32 nFillColor = GetColor(rBrush.GetColor());
rPropOpt.AddOpt( ESCHER_Prop_fillColor, nFillColor );
rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, nFillColor ^ 0xffffff );
rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100010 );
@@ -1929,7 +1929,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
{
if( bFirstLine )
{
- sal_uInt32 nLineColor = GetColor(pLine->GetColor(), false);
+ sal_uInt32 nLineColor = GetColor(pLine->GetColor());
rPropOpt.AddOpt( ESCHER_Prop_lineColor, nLineColor );
rPropOpt.AddOpt( ESCHER_Prop_lineBackColor,
nLineColor ^ 0xffffff );
More information about the Libreoffice-commits
mailing list