Kaydet (Commit) 2087484c authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

use consistent #define checks for the Windows platform

stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst d6bf0860
......@@ -192,7 +192,7 @@ OUString OAccessibleMenuItemComponent::GetAccessibleName()
if ( sName.isEmpty() )
sName = m_pParent->GetItemText( nItemId );
sName = OutputDevice::GetNonMnemonicString( sName );
#if defined WNT
#if defined(_WIN32)
if ( m_pParent->GetAccelKey( nItemId ).GetName().getLength() )
sName = sName + "\t" + m_pParent->GetAccelKey(nItemId).GetName();
#endif
......
......@@ -124,7 +124,7 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
if ( pList != nullptr )
{
pList->ProcessWindowEvent (rVclWindowEvent, m_bIsDropDownBox);
#if defined WNT
#if defined(_WIN32)
if (m_bIsDropDownBox)
{
NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
......@@ -181,7 +181,7 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
if ( sText.isEmpty() )
sText = xText->getText();
pList->UpdateSelection_Acc(sText, m_bIsDropDownBox);
#if defined WNT
#if defined(_WIN32)
if (m_bIsDropDownBox || m_aBoxType==COMBOBOX)
NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
#endif
......
......@@ -28,7 +28,7 @@ class ResMgr;
#define AVMEDIA_RESSTR( nId ) AVMEDIA_RESID( nId ).toString()
#define AVMEDIA_MANAGER_SERVICE_PREFERRED "com.sun.star.comp.avmedia.Manager_VLC"
#ifdef WNT
#ifdef _WIN32
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX"
#else
#ifdef MACOSX
......
......@@ -9,7 +9,7 @@
#ifndef INCLUDED_AVMEDIA_SOURCE_VLC_WRAPPER_SYMBOLLOADER_HXX
#define INCLUDED_AVMEDIA_SOURCE_VLC_WRAPPER_SYMBOLLOADER_HXX
#if defined( WNT )
#if defined(_WIN32)
# include <windows.h>
# include <winreg.h>
#endif
......
......@@ -12,7 +12,7 @@
#ifndef INCLUDED_AVMEDIA_SOURCE_VLC_WRAPPER_TYPES_HXX
#define INCLUDED_AVMEDIA_SOURCE_VLC_WRAPPER_TYPES_HXX
#if defined WNT
#if defined(_WIN32)
typedef __int64 libvlc_time_t;
#else
typedef int64_t libvlc_time_t;
......
......@@ -64,7 +64,7 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::resource;
using namespace ::com::sun::star::ui::dialogs;
#ifdef WNT
#ifdef _WIN32
char const FilterMask_All[] = "*.*";
#else
char const FilterMask_All[] = "*";
......
......@@ -81,7 +81,7 @@ void VBATest::testMiscVBAFunctions()
void VBATest::testMiscOLEStuff()
{
// not much point even trying to run except on windows
#if defined(WNT)
#if defined(_WIN32)
// test if we have the necessary runtime environment
// to run the OLE tests.
uno::Reference< lang::XMultiServiceFactory > xOLEFactory;
......
......@@ -848,7 +848,7 @@ void SbiParser::AddConstants()
addStringConst( aPublics, "vbCrLf", "\x0D\x0A" );
addStringConst( aPublics, "vbFormFeed", "\x0C" );
addStringConst( aPublics, "vbLf", "\x0A" );
#ifndef WNT
#ifndef _WIN32
addStringConst( aPublics, "vbNewLine", "\x0D\x0A" );
#else
addStringConst( aPublics, "vbNewLine", "\x0A" );
......
......@@ -19,7 +19,7 @@
#include <sal/config.h>
#if defined(WNT)
#if defined(_WIN32)
#include <prewin.h>
#include <postwin.h>
#endif
......
......@@ -19,7 +19,7 @@
#include <sal/config.h>
#if defined(WNT)
#if defined(_WIN32)
#include <prewin.h>
#include <postwin.h>
#endif
......
......@@ -19,7 +19,7 @@
#include <sal/config.h>
#if defined(WNT)
#if defined(_WIN32)
#include <prewin.h>
#include <postwin.h>
#endif
......
......@@ -88,7 +88,7 @@ using namespace com::sun::star::uno;
#include "sbobjmod.hxx"
#include "sbxmod.hxx"
#ifdef WNT
#ifdef _WIN32
#include <prewin.h>
#include <direct.h>
#include <io.h>
......@@ -392,7 +392,7 @@ RTLFUNC(CurDir)
// there's no possibility to detect the current one in a way that a virtual URL
// could be delivered.
#if defined (WNT)
#if defined(_WIN32)
int nCurDir = 0; // Current dir // JSM
if ( rPar.Count() == 2 )
{
......@@ -3117,7 +3117,7 @@ RTLFUNC(GetAttr)
// In Windows, we want to use Windows API to get the file attributes
// for VBA interoperability.
#if defined( WNT )
#if defined(_WIN32)
if( SbiRuntime::isVBAEnabled() )
{
OUString aPathURL = getFullPath( rPar.Get(1)->GetOUString() );
......
......@@ -284,7 +284,7 @@ RTLFUNC(CDec)
(void)pBasic;
(void)bWrite;
#ifdef WNT
#ifdef _WIN32
SbxDecimal* pDec = NULL;
if ( rPar.Count() == 2 )
{
......@@ -525,9 +525,9 @@ RTLFUNC(GetGUIType)
else
{
// 17.7.2000 Make simple solution for testtool / fat office
#if defined (WNT)
#if defined(_WIN32)
rPar.Get(0)->PutInteger( 1 );
#elif defined UNX
#elif defined(UNX)
rPar.Get(0)->PutInteger( 4 );
#else
rPar.Get(0)->PutInteger( -1 );
......
......@@ -21,7 +21,7 @@
#ifndef INCLUDED_BASIC_SOURCE_SBX_SBXDEC_HXX
#define INCLUDED_BASIC_SOURCE_SBX_SBXDEC_HXX
#ifdef WNT
#ifdef _WIN32
#include <prewin.h>
#include <postwin.h>
......
......@@ -750,7 +750,7 @@ def generate(includes, libname, filename, module):
# svx needs this (sendreportw32.cxx)
if module == 'svx' and libname == 'svx':
svx_define = """
#ifdef WNT
#ifdef _WIN32
# define UNICODE
# define _UNICODE
#endif
......@@ -767,7 +767,7 @@ def generate(includes, libname, filename, module):
(module == 'xmlsecurity' and libname == 'xsec_xmlsec'):
ado_define = """
// Cleanup windows header macro pollution.
#if defined(WNT) && defined(WINAPI)
#if defined(_WIN32) && defined(WINAPI)
# include <postwin.h>
# undef RGB
#endif
......
......@@ -36,7 +36,7 @@
using namespace ::com::sun::star;
#if defined(WNT) || defined (MACOSX)
#if defined(_WIN32) || defined (MACOSX)
# error "The cairo canvas should not be enabled on Windows or Mac cf fdo#46901"
#endif
......
......@@ -24,7 +24,7 @@
#include <canvas/elapsedtime.hxx>
#if defined(WNT)
#if defined(_WIN32)
#if defined _MSC_VER
#pragma warning(push,1)
......@@ -50,7 +50,7 @@ namespace canvas {
namespace tools {
#if defined(WNT)
#if defined(_WIN32)
// TODO(Q2): is 0 okay for the failure case here?
double ElapsedTime::getSystemTime()
{
......
......@@ -20,7 +20,7 @@
#include <DataSeriesHelper.hxx>
#include <osl/time.h>
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#endif
#include <memory>
......
......@@ -19,7 +19,7 @@
#include "sal/config.h"
#if defined WNT
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
......
......@@ -664,7 +664,7 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
return UpdateMediaDescriptorWithFilterName( aMediaDescr, true );
}
#ifdef WNT
#ifdef _WIN32
SfxFilterFlags MimeConfigurationHelper::GetFilterFlags( const OUString& aFilterName )
{
......
......@@ -69,7 +69,7 @@
#include <dconf.hxx>
#endif
#if defined WNT
#if defined(_WIN32)
#include "winreg.hxx"
#endif
......@@ -546,7 +546,7 @@ Components::Components(
}
++layer; //TODO: overflow
#endif
#if defined WNT
#if defined(_WIN32)
} else if (type == "winreg") {
WinRegType eType;
if (url == "LOCAL_MACHINE" || url.isEmpty()/*backwards comp.*/) {
......
......@@ -93,7 +93,7 @@ TempFile::~TempFile() {
}
}
#ifdef WNT
#ifdef _WIN32
oslFileError TempFile::closeWithoutUnlink() {
flush();
oslFileError e = osl_closeFile(handle);
......
......@@ -38,7 +38,7 @@ struct TempFile {
~TempFile();
void closeAndRename(const OUString &url);
oslFileError flush();
#ifdef WNT
#ifdef _WIN32
oslFileError closeWithoutUnlink();
#endif
void writeString(char const *begin, sal_Int32 length);
......
......@@ -70,7 +70,7 @@
#include <connectivity/sdbcx/IRefreshable.hxx>
// Cleanup windows header macro pollution.
#ifdef WNT
#ifdef _WIN32
# include <postwin.h>
# undef RGB
#endif
......
......@@ -119,7 +119,7 @@ namespace connectivity
OUString StorageContainer::removeOldURLPrefix(const OUString& _sURL)
{
OUString sRet = _sURL;
#if defined(WNT)
#if defined(_WIN32)
sal_Int32 nIndex = sRet.lastIndexOf('\\');
#else
sal_Int32 nIndex = sRet.lastIndexOf('/');
......
......@@ -25,7 +25,7 @@
#include <string.h>
#endif // End UNIX
#ifdef WNT
#ifdef _WIN32
#include <windows.h>
#include <stdlib.h>
#include <shlobj.h>
......
......@@ -90,7 +90,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath)
if (bLoaded)
return true;
#ifdef WNT
#ifdef _WIN32
_rPath = "ODBC32.DLL";
#endif
#ifdef UNX
......
......@@ -24,7 +24,7 @@
#include <cppuhelper/findsofficepath.h>
#if defined WNT
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
......
......@@ -961,7 +961,7 @@ void TPGalleryThemeProperties::FillFilterList()
}
}
#if defined(WNT)
#if defined(_WIN32)
if (aExtensions.getLength() > 240)
aExtensions = "*.*";
#endif
......
......@@ -214,7 +214,7 @@ namespace
return OUString();
#endif
}
#if defined WNT
#if defined(_WIN32)
return OUString("com.sun.star.ui.dialogs.SystemFilePicker");
#elif defined MACOSX
return OUString("com.sun.star.ui.dialogs.AquaFilePicker");
......
......@@ -130,7 +130,7 @@ OfaMemoryOptionsPage::OfaMemoryOptionsPage(vcl::Window* pParent, const SfxItemSe
m_pQuickLaunchCB->Show();
//Only available in Win or if building the gtk systray
#if !defined(WNT) && ! ENABLE_GTK
#if !defined(_WIN32) && ! ENABLE_GTK
m_pQuickStarterFrame->Hide();
#endif
......
......@@ -1768,7 +1768,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
nPageId = (sal_uInt16)rInetArray.GetValue(i);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
#if defined WNT
#if defined(_WIN32)
// Disable E-mail tab-page on Windows
if ( nPageId == RID_SVXPAGE_INET_MAIL )
continue;
......
......@@ -2411,7 +2411,7 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
OStringBuffer sData;
const sal_Char aLineEnd[] =
#if defined(WNT)
#if defined(_WIN32)
"\015\012";
#else
"\012";
......
......@@ -330,7 +330,7 @@ SvxCharNamePage::SvxCharNamePage( vcl::Window* pParent, const SfxItemSet& rInSet
//Family, Style
//In Windows the standard dialogs name font-name, font-style as
//Font, Style
#ifdef WNT
#ifdef _WIN32
OUString sFontFamilyString(CUI_RES(RID_SVXSTR_CHARNAME_FONT));
#else
OUString sFontFamilyString(CUI_RES(RID_SVXSTR_CHARNAME_FAMILY));
......
......@@ -505,7 +505,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
m_pLbGradients->SelectEntryPos( m_pLbGradients->GetEntryCount() - 1 );
#ifdef WNT
#ifdef _WIN32
// hack: #31355# W.P.
Rectangle aRect( m_pLbGradients->GetPosPixel(), m_pLbGradients->GetSizePixel() );
if( sal_True ) { // ??? overlapped with pDlg
......
......@@ -539,7 +539,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
m_pLbHatchings->SelectEntryPos( m_pLbHatchings->GetEntryCount() - 1 );
#ifdef WNT
#ifdef _WIN32
// hack: #31355# W.P.
Rectangle aRect( m_pLbHatchings->GetPosPixel(), m_pLbHatchings->GetSizePixel() );
if( sal_True ) { // ??? overlapped with pDlg
......
......@@ -46,7 +46,7 @@ public:
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(WNT)
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
......
......@@ -46,7 +46,7 @@ public:
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(WNT)
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
......
......@@ -23,7 +23,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
#if !defined(MACOSX) && !defined(WNT)
#if !defined(MACOSX) && !defined(_WIN32)
class DBAccessTest : public UnoApiTest
{
......
......@@ -46,7 +46,7 @@ public:
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(WNT)
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
......
......@@ -60,7 +60,7 @@
#include <tools/diagnose_ex.h>
#include <sfx2/docfilt.hxx>
#if defined(WNT)
#if defined(_WIN32)
#define _ADO_DATALINK_BROWSE_
#endif
......
......@@ -59,7 +59,7 @@
#include <connectivity/CommonTools.hxx>
#include <sfx2/docfilt.hxx>
#include "dsnItem.hxx"
#if defined(WNT)
#if defined(_WIN32)
#define _ADO_DATALINK_BROWSE_
#endif
......
......@@ -18,7 +18,7 @@
*/
#if defined(WNT)
#if defined(_WIN32)
#if defined _MSC_VER
#pragma warning(push, 1)
#pragma warning(disable: 4917)
......
......@@ -31,7 +31,7 @@
#ifdef HAVE_ODBC_SUPPORT
#if defined WNT
#if defined(_WIN32)
#define ODBC_LIBRARY "ODBC32.DLL"
#endif
#ifdef UNX
......
......@@ -22,11 +22,11 @@
#include "commontypes.hxx"
#if defined(WNT) || (defined (UNX) && !defined(ANDROID) && !defined(IOS))
#if defined(_WIN32) || (defined (UNX) && !defined(ANDROID) && !defined(IOS))
#define HAVE_ODBC_SUPPORT
#endif
#if defined(WNT) && defined(HAVE_ODBC_SUPPORT)
#if defined(_WIN32) && defined(HAVE_ODBC_SUPPORT)
#define HAVE_ODBC_ADMINISTRATION
#endif
......
......@@ -124,7 +124,7 @@
#include <sys/wait.h>
#endif
#ifdef WNT
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#pragma warning (disable: 4005)
......@@ -136,7 +136,7 @@
#endif
#endif //WNT
#if defined WNT
#if defined(_WIN32)
#include <process.h>
#define GETPID _getpid
#else
......@@ -1895,7 +1895,7 @@ IMPL_LINK_NOARG_TYPED(Desktop, OpenClients_Impl, void*, void)
CloseSplashScreen();
CheckFirstRun( );
#ifdef WNT
#ifdef _WIN32
// Registers a COM class factory of the service manager with the windows operating system.
Reference< XMultiServiceFactory > xSMgr= comphelper::getProcessServiceFactory();
xSMgr->createInstance("com.sun.star.bridge.OleApplicationRegistration");
......@@ -2180,7 +2180,7 @@ void Desktop::OpenClients()
{
aIniName = aIniName.copy( 0, lastIndex+1 );
aIniName += "perftune";
#if defined(WNT)
#if defined(_WIN32)
aIniName += ".ini";
#else
aIniName += "rc";
......@@ -2784,7 +2784,7 @@ void Desktop::CheckFirstRun( )
m_firstRunTimer.SetTimeoutHdl(LINK(this, Desktop, AsyncInitFirstRun));
m_firstRunTimer.Start();
#ifdef WNT
#ifdef _WIN32
// Check if Quickstarter should be started (on Windows only)
TCHAR szValue[8192];
DWORD nValueSize = sizeof(szValue);
......
......@@ -499,7 +499,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
{
aIniName = aIniName.copy( 0, lastIndex+1 );
aIniName += "perftune";
#if defined(WNT)
#if defined(_WIN32)
aIniName += ".ini";
#else
aIniName += "rc";
......
......@@ -79,7 +79,7 @@
#include <queue>
#include <memory>
#ifdef WNT
#ifdef _WIN32
#if defined _MSC_VER
#pragma warning (push, 1)
#pragma warning (disable: 4005)
......@@ -686,7 +686,7 @@ ExtensionCmdQueue::Thread::~Thread() {}
void ExtensionCmdQueue::Thread::execute()
{
#ifdef WNT
#ifdef _WIN32
//Needed for use of the service "com.sun.star.system.SystemShellExecute" in
//DialogHelper::openWebBrowser
CoUninitialize();
......@@ -833,7 +833,7 @@ void ExtensionCmdQueue::Thread::execute()
currentCmdEnv->stopProgress();
}
//end for
#ifdef WNT
#ifdef _WIN32
CoUninitialize();
#endif
}
......
......@@ -46,7 +46,7 @@
#include <comphelper/processfactory.hxx>
#include <salhelper/linkhelper.hxx>
#ifdef WNT
#ifdef _WIN32
#define UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
......@@ -55,7 +55,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;