Kaydet (Commit) 841e1a6f authored tarafından Noel Grandin's avatar Noel Grandin

remove some old MSVC workarounds

Change-Id: I6abd8aaffb27b3c85df7c0518f7f576be4e32222
Reviewed-on: https://gerrit.libreoffice.org/36660Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4354f0e9
......@@ -66,7 +66,7 @@ ONDXKey::ONDXKey(double aVal, sal_uInt32 nRec)
// index page
ONDXPage::ONDXPage(ODbaseIndex& rInd, sal_uInt32 nPos, ONDXPage* pParent)
: nRefCount(0)
, bNoDelete(1)
, bNoDelete(true)
, nPagePos(nPos)
, bModified(false)
, nCount(0)
......@@ -110,7 +110,7 @@ void ONDXPage::QueryDelete()
ppNodes[i] = ONDXNode();
}
bNoDelete = 1;
bNoDelete = true;
nCount = 0;
aParent.Clear();
......
......@@ -120,8 +120,7 @@ namespace connectivity
// work around a clang 3.5 optimization bug: if the bNoDelete is *first*
// it mis-compiles "if (--nRefCount == 0)" and never deletes any object
unsigned int nRefCount : 31;
// the only reason this is not bool is because MSVC cannot handle mixed type bitfields
unsigned int bNoDelete : 1;
bool bNoDelete : 1;
sal_uInt32 nPagePos; // Position in the index file
bool bModified : 1;
sal_uInt16 nCount;
......@@ -190,7 +189,7 @@ namespace connectivity
{
assert( nRefCount < (1 << 30) && "Do not add refs to dead objects" );
if( bNoDelete )
bNoDelete = 0;
bNoDelete = false;
++nRefCount;
}
......
......@@ -43,18 +43,18 @@ Sequence< sal_Int8 > SAL_CALL OFormsCollection::getImplementationId( )
Sequence<Type> SAL_CALL OFormsCollection::getTypes()
{
return concatSequences(OInterfaceContainer::getTypes(), FormsCollectionComponentBase::getTypes(), OFormsCollection_BASE::getTypes());
return concatSequences(OInterfaceContainer::getTypes(), ::cppu::OComponentHelper::getTypes(), OFormsCollection_BASE::getTypes());
}
OFormsCollection::OFormsCollection(const Reference<XComponentContext>& _rxFactory)
:FormsCollectionComponentBase( m_aMutex )
: ::cppu::OComponentHelper( m_aMutex )
,OInterfaceContainer( _rxFactory, m_aMutex, cppu::UnoType<XForm>::get() )
,OFormsCollection_BASE()
{
}
OFormsCollection::OFormsCollection( const OFormsCollection& _cloneSource )
:FormsCollectionComponentBase( m_aMutex )
: ::cppu::OComponentHelper( m_aMutex )
,OInterfaceContainer( m_aMutex, _cloneSource )
,OFormsCollection_BASE()
{
......@@ -62,7 +62,7 @@ OFormsCollection::OFormsCollection( const OFormsCollection& _cloneSource )
OFormsCollection::~OFormsCollection()
{
if (!FormsCollectionComponentBase::rBHelper.bDisposed)
if (!::cppu::OComponentHelper::rBHelper.bDisposed)
{
acquire();
dispose();
......@@ -77,7 +77,7 @@ Any SAL_CALL OFormsCollection::queryAggregation(const Type& _rType)
aReturn = OInterfaceContainer::queryInterface(_rType);
if (!aReturn.hasValue())
aReturn = FormsCollectionComponentBase::queryAggregation(_rType);
aReturn = ::cppu::OComponentHelper::queryAggregation(_rType);
}
return aReturn;
......@@ -121,7 +121,7 @@ void OFormsCollection::disposing()
SAL_INFO( "forms.component", "forms::OFormsCollection::disposing" );
OInterfaceContainer::disposing();
}
FormsCollectionComponentBase::disposing();
::cppu::OComponentHelper::disposing();
m_xParent = nullptr;
}
......
......@@ -35,13 +35,10 @@ namespace frm
// Implements the UNO Container for Forms and contains all assigned Forms.
// It can either represent the Context for Forms or be passed a Context.
typedef ::cppu::OComponentHelper FormsCollectionComponentBase;
typedef ::cppu::ImplHelper2< css::form::XForms
,css::lang::XServiceInfo > OFormsCollection_BASE;
// else MSVC kills itself on some statements
typedef ::cppu::ImplHelper2< css::form::XForms
,css::lang::XServiceInfo > OFormsCollection_BASE;
class OFormsCollection
:public FormsCollectionComponentBase
:public ::cppu::OComponentHelper
,public OInterfaceContainer
,public OFormsCollection_BASE
{
......@@ -54,7 +51,7 @@ public:
virtual ~OFormsCollection() override;
public:
DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, FormsCollectionComponentBase)
DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, ::cppu::OComponentHelper)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override;
......@@ -135,11 +132,11 @@ public:
virtual void SAL_CALL removeScriptListener(const css::uno::Reference<css::script::XScriptListener>& p1) override
{ OInterfaceContainer::removeScriptListener(p1); }
virtual void SAL_CALL dispose() override
{ FormsCollectionComponentBase::dispose(); }
{ ::cppu::OComponentHelper::dispose(); }
virtual void SAL_CALL addEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override
{ FormsCollectionComponentBase::addEventListener(p1); }
{ ::cppu::OComponentHelper::addEventListener(p1); }
virtual void SAL_CALL removeEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override
{ FormsCollectionComponentBase::removeEventListener(p1); }
{ ::cppu::OComponentHelper::removeEventListener(p1); }
virtual void SAL_CALL addContainerListener(const css::uno::Reference<css::container::XContainerListener>& p1) override
{ OInterfaceContainer::addContainerListener(p1); }
virtual void SAL_CALL removeContainerListener(const css::uno::Reference<css::container::XContainerListener>& p1) override
......
......@@ -275,9 +275,7 @@ private:
};
typedef ::cppu::ImplHelper1< css::form::XFormComponent> OFormComponents_BASE;
typedef ::cppu::OComponentHelper FormComponentsBase;
// else MSVC kills itself on some statements
class OFormComponents :public FormComponentsBase
class OFormComponents :public ::cppu::OComponentHelper
,public OInterfaceContainer
,public OFormComponents_BASE
{
......@@ -290,7 +288,7 @@ public:
OFormComponents( const OFormComponents& _cloneSource );
virtual ~OFormComponents() override;
DECLARE_UNO3_AGG_DEFAULTS(OFormComponents, FormComponentsBase)
DECLARE_UNO3_AGG_DEFAULTS(OFormComponents, ::cppu::OComponentHelper)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override;
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
......
......@@ -1252,7 +1252,7 @@ Any SAL_CALL OFormComponents::queryAggregation(const Type& _rType)
aReturn = OInterfaceContainer::queryInterface(_rType);
if (!aReturn.hasValue())
aReturn = FormComponentsBase::queryAggregation(_rType);
aReturn = ::cppu::OComponentHelper::queryAggregation(_rType);
}
return aReturn;
......@@ -1261,12 +1261,12 @@ Any SAL_CALL OFormComponents::queryAggregation(const Type& _rType)
Sequence<Type> SAL_CALL OFormComponents::getTypes()
{
return ::comphelper::concatSequences(OInterfaceContainer::getTypes(), FormComponentsBase::getTypes(), OFormComponents_BASE::getTypes());
return ::comphelper::concatSequences(OInterfaceContainer::getTypes(), ::cppu::OComponentHelper::getTypes(), OFormComponents_BASE::getTypes());
}
OFormComponents::OFormComponents(const Reference<XComponentContext>& _rxFactory)
:FormComponentsBase( m_aMutex )
: ::cppu::OComponentHelper( m_aMutex )
,OInterfaceContainer( _rxFactory, m_aMutex, cppu::UnoType<XFormComponent>::get() )
,OFormComponents_BASE()
{
......@@ -1274,7 +1274,7 @@ OFormComponents::OFormComponents(const Reference<XComponentContext>& _rxFactory)
OFormComponents::OFormComponents( const OFormComponents& _cloneSource )
:FormComponentsBase( m_aMutex )
: ::cppu::OComponentHelper( m_aMutex )
,OInterfaceContainer( m_aMutex, _cloneSource )
,OFormComponents_BASE()
{
......@@ -1283,7 +1283,7 @@ OFormComponents::OFormComponents( const OFormComponents& _cloneSource )
OFormComponents::~OFormComponents()
{
if (!FormComponentsBase::rBHelper.bDisposed)
if (! ::cppu::OComponentHelper::rBHelper.bDisposed)
{
acquire();
dispose();
......@@ -1295,7 +1295,7 @@ OFormComponents::~OFormComponents()
void OFormComponents::disposing()
{
OInterfaceContainer::disposing();
FormComponentsBase::disposing();
::cppu::OComponentHelper::disposing();
m_xParent = nullptr;
}
......
......@@ -20,8 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_XML_ACCELERATORCONFIGURATIONREADER_HXX
#define INCLUDED_FRAMEWORK_INC_XML_ACCELERATORCONFIGURATIONREADER_HXX
#include <xml/saxnamespacefilter.hxx> // HACK: needed for MSVC 2013 ENABLE_LTO build: WeakImplHelper<XDocumentHandler>
#include <accelerators/acceleratorcache.hxx>
#include <macros/xinterface.hxx>
#include <general.h>
......
......@@ -24,7 +24,6 @@
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <xml/saxnamespacefilter.hxx> // HACK: needed for MSVC 2013 ENABLE_LTO build: WeakImplHelper<XDocumentHandler>
#include <xml/imagesconfiguration.hxx>
#include <rtl/ustring.hxx>
#include <cppuhelper/implbase.hxx>
......
......@@ -59,11 +59,10 @@ public:
};
MyInterceptor::MyInterceptor()
: m_nExpected(0),
: m_aDisabledCommands {".uno:Bold"},
m_nExpected(0),
m_nUnexpected(0)
{
// Not part of the initializer list as MSVC 2013 would not handle that.
m_aDisabledCommands = {".uno:Bold"};
}
int MyInterceptor::getExpected()
......
......@@ -25,6 +25,7 @@
#include <acceleratorconst.h>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
#include <com/sun/star/awt/Key.hpp>
......
......@@ -22,6 +22,7 @@
#include <xml/imagesdocumenthandler.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
......
......@@ -17,9 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// prevent internal compiler error with MSVC6SP3
#include <utility>
#include <cppuhelper/supportsservice.hxx>
#include <chaptercollator.hxx>
#include <com/sun/star/i18n/KCharacterType.hpp>
......
......@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// prevent internal compiler error with MSVC6SP3
#include <utility>
#include <i18nutil/widthfolding.hxx>
#include <comphelper/string.hxx>
#include "widthfolding_data.h"
......
......@@ -272,13 +272,7 @@ public:
virtual bool SetParent( const OUString& ) override;
protected:
SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper
: SfxStyleSheetBase("dummy", nullptr, SfxStyleFamily::All, 0)
{
assert(false);
}
virtual ~SfxStyleSheet() override;
};
class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool
......
......@@ -122,22 +122,21 @@ class TOOLS_DLLPUBLIC SvRefBase
// work around a clang 3.5 optimization bug: if the bNoDelete is *first*
// it mis-compiles "if (--nRefCount == 0)" and never deletes any object
unsigned int nRefCount : 31;
// the only reason this is not bool is because MSVC cannot handle mixed type bitfields
unsigned int bNoDelete : 1;
bool bNoDelete : 1;
protected:
virtual ~SvRefBase();
public:
SvRefBase() : nRefCount(0), bNoDelete(1) {}
SvRefBase() : nRefCount(0), bNoDelete(true) {}
SvRefBase(const SvRefBase &) : nRefCount(0), bNoDelete(1) {}
SvRefBase(const SvRefBase &) : nRefCount(0), bNoDelete(true) {}
SvRefBase & operator = ( const SvRefBase & )
{ return *this; }
void RestoreNoDelete()
{ bNoDelete = 1; }
{ bNoDelete = true; }
void AddNextRef()
{
......@@ -149,7 +148,7 @@ public:
{
assert( nRefCount < (1 << 30) && "Do not add refs to dead objects" );
if( bNoDelete )
bNoDelete = 0;
bNoDelete = false;
++nRefCount;
}
......
......@@ -61,7 +61,6 @@ private:
static S f(T1 *, int);
struct H {
H(); // avoid C2514 "class has no constructors" from MSVC 2008
operator T1 * () const;
operator T2 * ();
};
......
......@@ -17,23 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* Somehow, under same circumstances, MSVC creates object code for 2
* inlined functions. Nobody here uses them, so simply define them away
* so that there be no dupplicate symbols anymore.
* The symbols "extents" and "indices" come from boost::multi_array.
*/
#ifdef indices
#undef indices
#endif
#define indices dummy1_indices
#ifdef extents
#undef extents
#endif
#define extents dummy1_extents
#include "AccessibleDocument.hxx"
#include "AccessibleSpreadsheet.hxx"
#include "tabvwsh.hxx"
......
......@@ -19,23 +19,6 @@
#include <sal/config.h>
/* Somehow, under same circumstances, MSVC creates object code for 2
* inlined functions. Nobody here uses them, so simply define them away
* so that there be no dupplicate symbols anymore.
* The symbols "extents" and "indices" come from boost::multi_array.
*/
#ifdef indices
#undef indices
#endif
#define indices dummy2_indices
#ifdef extents
#undef extents
#endif
#define extents dummy2_extents
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
#include <tools/gen.hxx>
......
......@@ -137,13 +137,7 @@ void SmWordExportBase::HandleUnaryOperation(const SmUnHorNode* pNode, int nLevel
// update HandleMath() when adding new items
SAL_INFO("starmath.wordbase", "Unary: " << int(pNode->GetToken().eType));
// Avoid MSVC warning C4065: switch statement contains 'default' but no 'case' labels
// switch( pNode->GetToken().eType )
// {
// default:
HandleAllSubNodes(pNode, nLevel);
// break;
// }
}
void SmWordExportBase::HandleBinaryOperation(const SmBinHorNode* pNode, int nLevel)
......
......@@ -1053,18 +1053,10 @@ void SaveTable::CreateNew( SwTable& rTable, bool bCreateFrames,
}
}
#ifdef _MSC_VER
// MSVC 2012 appears very confused and rambles about a declaration of "n" below
#pragma warning (push, 1)
#pragma warning (disable: 4258)
#endif
for( SwTableLines::const_iterator it = rTable.GetTabLines().begin() + n;
it != rTable.GetTabLines().begin() + nOldLines; ++it )
delete *it;
rTable.GetTabLines().erase( rTable.GetTabLines().begin() + n, rTable.GetTabLines().begin() + nOldLines );
#ifdef _MSC_VER
#pragma warning (pop)
#endif
}
aParent.GetTabLines().erase( aParent.GetTabLines().begin(), aParent.GetTabLines().begin() + n );
......
......@@ -2601,12 +2601,11 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
Get the record for top level object, so we can get the word anchoring
and wrapping information for it.
*/
for (MSDffImportRecords::const_iterator it = aData.begin();
it != aData.end(); ++it) // MSVC2008 wants const_iterator here???
for (auto const & it : aData)
{
if ((*it)->pObj == pObject)
if (it->pObj == pObject)
{
pRecord = it->get();
pRecord = it.get();
break;
}
}
......
......@@ -327,7 +327,7 @@ sal_uInt16 Date::GetDayOfYear() const
Normalize( nDay, nMonth, nYear);
for( sal_uInt16 i = 1; i < nMonth; i++ )
nDay = nDay + ::ImplDaysInMonth( i, nYear ); // += yields a warning on MSVC, so don't use it
nDay += ::ImplDaysInMonth( i, nYear );
return nDay;
}
......
......@@ -349,7 +349,7 @@ void BigInt::DivLong( const BigInt& rB, BigInt& rErg ) const
nK = (sal_uInt16)(0x10000UL - nK);
}
unsigned short& rNum( aTmpA.nNum[j - nLenB + i] );
rNum = rNum - nK; // MSVC yields a warning on -= here, so don't use it
rNum -= nK;
if (aTmpA.nNum[j - nLenB + i] == 0)
rErg.nNum[j - nLenB] = nQ;
else
......
......@@ -267,8 +267,6 @@ public:
, m_bTrueColor(false)
{
}
JPGEmit(const JPGEmit&) = delete; // to keep MSVC2013 happy
JPGEmit(JPGEmit&&); // to keep MSVC2013 happy
};
struct GradientEmit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment