summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-28 15:27:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-29 06:42:30 +0000
commit5a725d1fde7381ef9c02afcb639235a11e52182c (patch)
treec1dfea787afb28c43be74eb981976e858550ccd1 /sd
parent2729994bc519597db205aeeb4b2242a45c57712f (diff)
loplugin:singlevalfields
Change-Id: I7f05903aaab9b0b274358243d680d0c30694ae61 Reviewed-on: https://gerrit.libreoffice.org/35804 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/ppt/pptin.cxx1
-rw-r--r--sd/source/ui/dlg/docprev.cxx25
-rw-r--r--sd/source/ui/inc/docprev.hxx7
-rw-r--r--sd/source/ui/remotecontrol/BluetoothServer.cxx6
4 files changed, 10 insertions, 29 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index be6fd0f9ed18..35995897fa88 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -420,7 +420,6 @@ bool ImplSdPPTImport::Import()
if ( !aPropItem.Read( pHyperlink->aSubAdress ) )
break;
- pHyperlink->nStartPos = -1;
if ( !pHyperlink->aSubAdress.isEmpty() ) // get the converted subaddress
{
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index 6efc4a9f826b..d757d4bfb322 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -53,7 +53,7 @@ const int SdDocPreviewWin::FRAME = 4;
VCL_BUILDER_FACTORY_CONSTRUCTOR(SdDocPreviewWin, 0)
SdDocPreviewWin::SdDocPreviewWin( vcl::Window* pParent, const WinBits nStyle )
-: Control(pParent, nStyle), pMetaFile( nullptr )
+: Control(pParent, nStyle)
{
SetBorderStyle( WindowBorderStyle::MONO );
svtools::ColorConfig aColorConfig;
@@ -73,8 +73,6 @@ void SdDocPreviewWin::dispose()
mxSlideShow->end();
mxSlideShow.clear();
}
- delete pMetaFile;
- pMetaFile = nullptr;
Control::dispose();
}
@@ -90,15 +88,14 @@ void SdDocPreviewWin::Resize()
mxSlideShow->resize( GetSizePixel() );
}
-void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rPoint )
+void SdDocPreviewWin::CalcSizeAndPos( Size& rSize, Point& rPoint )
{
- Size aTmpSize = pFile ? pFile->GetPrefSize() : Size(1,1 );
long nWidth = rSize.Width() - 2*FRAME;
long nHeight = rSize.Height() - 2*FRAME;
if( nWidth < 0 ) nWidth = 0;
if( nHeight < 0 ) nHeight = 0;
- double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
+ double dRatio = 1;
double dRatioPreV = nHeight ? (((double) nWidth ) / nHeight) : 0.0;
if (dRatio > dRatioPreV)
@@ -113,12 +110,12 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rP
}
}
-void SdDocPreviewWin::ImpPaint( GDIMetaFile* pFile, OutputDevice* pVDev )
+void SdDocPreviewWin::ImpPaint( OutputDevice* pVDev )
{
Point aPoint;
Size aSize = pVDev->GetOutputSize();
Point bPoint(aSize.Width()-2*FRAME, aSize.Height()-2*FRAME );
- CalcSizeAndPos( pFile, aSize, aPoint );
+ CalcSizeAndPos( aSize, aPoint );
bPoint -= aPoint;
aPoint += Point( FRAME, FRAME );
@@ -127,13 +124,6 @@ void SdDocPreviewWin::ImpPaint( GDIMetaFile* pFile, OutputDevice* pVDev )
pVDev->SetLineColor();
pVDev->SetFillColor( Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor ) );
pVDev->DrawRect(Rectangle( Point(0,0 ), pVDev->GetOutputSize()));
- if( pFile )
- {
- pVDev->SetFillColor( maDocumentColor );
- pVDev->DrawRect(Rectangle(aPoint, aSize));
- pFile->WindStart();
- pFile->Play( pVDev, aPoint, aSize );
- }
}
void SdDocPreviewWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect )
@@ -146,7 +136,7 @@ void SdDocPreviewWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Recta
? ::sd::OUTPUT_DRAWMODE_CONTRAST
: ::sd::OUTPUT_DRAWMODE_COLOR );
- ImpPaint( pMetaFile, this );
+ ImpPaint( this );
}
else
{
@@ -185,9 +175,6 @@ void SdDocPreviewWin::updateViewSettings()
maDocumentColor = Color( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
}
- delete pMetaFile;
- pMetaFile = nullptr;
-
Invalidate();
}
diff --git a/sd/source/ui/inc/docprev.hxx b/sd/source/ui/inc/docprev.hxx
index 2fe0e851da5a..51f55abc8631 100644
--- a/sd/source/ui/inc/docprev.hxx
+++ b/sd/source/ui/inc/docprev.hxx
@@ -36,20 +36,17 @@ namespace sd {
class SlideShow;
}
-class GDIMetaFile;
-
class SD_DLLPUBLIC SdDocPreviewWin : public Control, public SfxListener
{
protected:
- GDIMetaFile* pMetaFile;
Link<SdDocPreviewWin&,void> aClickHdl;
Color maDocumentColor;
rtl::Reference< sd::SlideShow > mxSlideShow;
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override;
virtual Size GetOptimalSize() const override;
- static void CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rPoint );
- void ImpPaint( GDIMetaFile* pFile, OutputDevice* pVDev );
+ static void CalcSizeAndPos( Size& rSize, Point& rPoint );
+ static void ImpPaint( OutputDevice* pVDev );
static const int FRAME;
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 9662e6135ce5..bf68261e95e1 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -93,7 +93,6 @@ struct sd::BluetoothServer::Impl {
GMainContext *mpContext;
DBusConnection *mpConnection;
DBusObject *mpService;
- volatile bool mbExitMainloop;
enum BluezVersion { BLUEZ4, BLUEZ5, UNKNOWN };
BluezVersion maBluezVersion;
@@ -101,7 +100,6 @@ struct sd::BluetoothServer::Impl {
: mpContext( g_main_context_new() )
, mpConnection( nullptr )
, mpService( nullptr )
- , mbExitMainloop( false )
, maBluezVersion( UNKNOWN )
{ }
@@ -1204,7 +1202,7 @@ void SAL_CALL BluetoothServer::run()
// TODO: exit on SD deinit
// Probably best to do that in SdModule::~SdModule?
- while (!mpImpl->mbExitMainloop)
+ while (true)
{
aDBusFD.revents = 0;
g_main_context_iteration( mpImpl->mpContext, TRUE );
@@ -1244,7 +1242,7 @@ void SAL_CALL BluetoothServer::run()
mpImpl->mpConnection = pConnection;
- while( !mpImpl->mbExitMainloop )
+ while( true )
{
aDBusFD.revents = 0;
aSocketFD.revents = 0;