2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-11 09:51:50 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-02-03 19:46:36 +00:00
|
|
|
|
Avoid "delayed" rendering in the tiled rendering case
Obviously, when using tiled rendering, all of the tile should be
rendered at once during the call to lo_touch_draw_tile(). Nothing
should be delayed to happen later (when the PaintTimer fires). The
main culprit causing such "delayed" rendering, at least in a certain
test document, seems to be SmartArt objects.
It is not 100% clear how to determine whether tiled rendering is being
used, though. For now, let's assume it is always the case on
non-desktop (i.e. iOS and Android, even if for Android we dont
actually do it). For desktop platforms, including liblibreoffice, will
have to figure out later how we want to do it, assume never for now.
Change-Id: I0f7e7172e7a699a0c6752ee465776f9da5c3098e
2014-03-10 17:27:25 +02:00
|
|
|
#include <config_features.h>
|
2006-09-17 13:23:26 +00:00
|
|
|
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/fltrcfg.hxx>
|
2004-02-03 19:46:36 +00:00
|
|
|
#include <tools/debug.hxx>
|
2014-08-22 12:59:03 -03:00
|
|
|
#include <tools/solar.h>
|
2014-11-14 22:52:35 +01:00
|
|
|
#include <osl/diagnose.h>
|
2004-02-03 19:46:36 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
|
|
|
|
using namespace utl;
|
|
|
|
using namespace com::sun::star::uno;
|
2005-04-13 09:47:33 +00:00
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
#define FILTERCFG_WORD_CODE 0x0001
|
|
|
|
#define FILTERCFG_WORD_STORAGE 0x0002
|
|
|
|
#define FILTERCFG_EXCEL_CODE 0x0004
|
|
|
|
#define FILTERCFG_EXCEL_STORAGE 0x0008
|
|
|
|
#define FILTERCFG_PPOINT_CODE 0x0010
|
|
|
|
#define FILTERCFG_PPOINT_STORAGE 0x0020
|
|
|
|
#define FILTERCFG_MATH_LOAD 0x0100
|
|
|
|
#define FILTERCFG_MATH_SAVE 0x0200
|
|
|
|
#define FILTERCFG_WRITER_LOAD 0x0400
|
|
|
|
#define FILTERCFG_WRITER_SAVE 0x0800
|
|
|
|
#define FILTERCFG_CALC_LOAD 0x1000
|
|
|
|
#define FILTERCFG_CALC_SAVE 0x2000
|
|
|
|
#define FILTERCFG_IMPRESS_LOAD 0x4000
|
|
|
|
#define FILTERCFG_IMPRESS_SAVE 0x8000
|
2008-05-20 13:11:30 +00:00
|
|
|
#define FILTERCFG_EXCEL_EXECTBL 0x10000
|
2008-06-09 14:34:27 +00:00
|
|
|
#define FILTERCFG_ENABLE_PPT_PREVIEW 0x20000
|
|
|
|
#define FILTERCFG_ENABLE_EXCEL_PREVIEW 0x40000
|
|
|
|
#define FILTERCFG_ENABLE_WORD_PREVIEW 0x80000
|
2008-09-04 09:02:04 +00:00
|
|
|
#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
|
2010-10-06 10:16:39 +01:00
|
|
|
#define FILTERCFG_WORD_WBCTBL 0x200000
|
2013-10-01 10:59:01 +02:00
|
|
|
#define FILTERCFG_SMARTART_SHAPE_LOAD 0x400000
|
2015-03-18 10:30:18 +01:00
|
|
|
#define FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING 0x8000000
|
2004-02-03 19:46:36 +00:00
|
|
|
|
|
|
|
class SvtAppFilterOptions_Impl : public utl::ConfigItem
|
|
|
|
{
|
2015-03-11 16:14:47 +01:00
|
|
|
private:
|
2014-02-19 12:30:34 +01:00
|
|
|
bool bLoadVBA;
|
|
|
|
bool bSaveVBA;
|
2015-03-11 16:14:47 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void ImplCommit() SAL_OVERRIDE;
|
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
public:
|
2015-05-25 15:28:47 +01:00
|
|
|
explicit SvtAppFilterOptions_Impl(const OUString& rRoot) :
|
2004-02-03 19:46:36 +00:00
|
|
|
utl::ConfigItem(rRoot),
|
2014-02-19 12:30:34 +01:00
|
|
|
bLoadVBA(false),
|
|
|
|
bSaveVBA(false) {}
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SvtAppFilterOptions_Impl();
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
|
2004-02-03 19:46:36 +00:00
|
|
|
void Load();
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsLoad() const {return bLoadVBA;}
|
|
|
|
void SetLoad(bool bSet)
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
if(bSet != bLoadVBA)
|
|
|
|
SetModified();
|
|
|
|
bLoadVBA = bSet;
|
|
|
|
}
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsSave() const {return bSaveVBA;}
|
|
|
|
void SetSave(bool bSet)
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
if(bSet != bSaveVBA)
|
|
|
|
SetModified();
|
|
|
|
bSaveVBA = bSet;
|
|
|
|
}
|
|
|
|
};
|
2008-05-20 13:11:30 +00:00
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
SvtAppFilterOptions_Impl::~SvtAppFilterOptions_Impl()
|
|
|
|
{
|
2015-03-11 16:39:24 +01:00
|
|
|
assert(!IsModified()); // should have been committed
|
2004-02-03 19:46:36 +00:00
|
|
|
}
|
|
|
|
|
2015-03-11 16:14:47 +01:00
|
|
|
void SvtAppFilterOptions_Impl::ImplCommit()
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
Sequence<OUString> aNames(2);
|
|
|
|
OUString* pNames = aNames.getArray();
|
2012-12-28 02:19:28 +01:00
|
|
|
pNames[0] = "Load";
|
|
|
|
pNames[1] = "Save";
|
2004-02-03 19:46:36 +00:00
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
|
|
|
|
2015-04-01 08:43:09 +02:00
|
|
|
const Type& rType = cppu::UnoType<bool>::get();
|
2004-02-03 19:46:36 +00:00
|
|
|
pValues[0].setValue(&bLoadVBA, rType);
|
|
|
|
pValues[1].setValue(&bSaveVBA, rType);
|
|
|
|
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
2009-10-16 00:05:16 +02:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SvtAppFilterOptions_Impl::Notify( const Sequence< OUString >& )
|
2009-10-16 00:05:16 +02:00
|
|
|
{
|
|
|
|
// no listeners supported yet
|
|
|
|
}
|
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
void SvtAppFilterOptions_Impl::Load()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames(2);
|
|
|
|
OUString* pNames = aNames.getArray();
|
2012-12-28 02:19:28 +01:00
|
|
|
pNames[0] = "Load";
|
|
|
|
pNames[1] = "Save";
|
2004-02-03 19:46:36 +00:00
|
|
|
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
|
|
|
|
if(pValues[0].hasValue())
|
2015-03-28 19:08:13 +01:00
|
|
|
bLoadVBA = *static_cast<sal_Bool const *>(pValues[0].getValue());
|
2004-02-03 19:46:36 +00:00
|
|
|
if(pValues[1].hasValue())
|
2015-03-28 19:08:13 +01:00
|
|
|
bSaveVBA = *static_cast<sal_Bool const *>(pValues[1].getValue());
|
2004-02-03 19:46:36 +00:00
|
|
|
}
|
2008-05-20 13:11:30 +00:00
|
|
|
|
2010-10-06 10:16:39 +01:00
|
|
|
class SvtWriterFilterOptions_Impl : public SvtAppFilterOptions_Impl
|
|
|
|
{
|
2015-03-11 16:14:47 +01:00
|
|
|
private:
|
2014-02-19 12:30:34 +01:00
|
|
|
bool bLoadExecutable;
|
2015-03-11 16:14:47 +01:00
|
|
|
|
|
|
|
virtual void ImplCommit() SAL_OVERRIDE;
|
|
|
|
|
2010-10-06 10:16:39 +01:00
|
|
|
public:
|
2015-05-25 15:28:47 +01:00
|
|
|
explicit SvtWriterFilterOptions_Impl(const OUString& rRoot) :
|
2010-10-06 10:16:39 +01:00
|
|
|
SvtAppFilterOptions_Impl(rRoot),
|
2014-02-19 12:30:34 +01:00
|
|
|
bLoadExecutable(false)
|
2010-10-06 10:16:39 +01:00
|
|
|
{}
|
|
|
|
void Load();
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsLoadExecutable() const {return bLoadExecutable;}
|
|
|
|
void SetLoadExecutable(bool bSet)
|
2010-10-06 10:16:39 +01:00
|
|
|
{
|
|
|
|
if(bSet != bLoadExecutable)
|
|
|
|
SetModified();
|
|
|
|
bLoadExecutable = bSet;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-03-11 16:14:47 +01:00
|
|
|
void SvtWriterFilterOptions_Impl::ImplCommit()
|
2010-10-06 10:16:39 +01:00
|
|
|
{
|
2015-03-11 16:14:47 +01:00
|
|
|
SvtAppFilterOptions_Impl::ImplCommit();
|
2010-10-06 10:16:39 +01:00
|
|
|
|
|
|
|
Sequence<OUString> aNames(1);
|
2012-12-28 02:19:28 +01:00
|
|
|
aNames[0] = "Executable";
|
2010-10-06 10:16:39 +01:00
|
|
|
Sequence<Any> aValues(1);
|
|
|
|
aValues[0] <<= bLoadExecutable;
|
|
|
|
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtWriterFilterOptions_Impl::Load()
|
|
|
|
{
|
|
|
|
SvtAppFilterOptions_Impl::Load();
|
|
|
|
|
|
|
|
Sequence<OUString> aNames(1);
|
2012-12-28 02:19:28 +01:00
|
|
|
aNames[0] = "Executable";
|
2010-10-06 10:16:39 +01:00
|
|
|
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
if(pValues[0].hasValue())
|
2015-03-28 19:08:13 +01:00
|
|
|
bLoadExecutable = *static_cast<sal_Bool const *>(pValues[0].getValue());
|
2010-10-06 10:16:39 +01:00
|
|
|
}
|
|
|
|
|
2008-05-20 13:11:30 +00:00
|
|
|
class SvtCalcFilterOptions_Impl : public SvtAppFilterOptions_Impl
|
|
|
|
{
|
2015-03-11 16:14:47 +01:00
|
|
|
private:
|
2014-02-19 12:30:34 +01:00
|
|
|
bool bLoadExecutable;
|
2015-03-11 16:14:47 +01:00
|
|
|
|
|
|
|
virtual void ImplCommit() SAL_OVERRIDE;
|
|
|
|
|
2008-05-20 13:11:30 +00:00
|
|
|
public:
|
2015-05-25 15:28:47 +01:00
|
|
|
explicit SvtCalcFilterOptions_Impl(const OUString& rRoot) :
|
2008-05-20 13:11:30 +00:00
|
|
|
SvtAppFilterOptions_Impl(rRoot),
|
2014-02-19 12:30:34 +01:00
|
|
|
bLoadExecutable(false)
|
2008-05-20 13:11:30 +00:00
|
|
|
{}
|
|
|
|
void Load();
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsLoadExecutable() const {return bLoadExecutable;}
|
|
|
|
void SetLoadExecutable(bool bSet)
|
2008-05-20 13:11:30 +00:00
|
|
|
{
|
|
|
|
if(bSet != bLoadExecutable)
|
|
|
|
SetModified();
|
|
|
|
bLoadExecutable = bSet;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-03-11 16:14:47 +01:00
|
|
|
void SvtCalcFilterOptions_Impl::ImplCommit()
|
2008-05-20 13:11:30 +00:00
|
|
|
{
|
2015-03-11 16:14:47 +01:00
|
|
|
SvtAppFilterOptions_Impl::ImplCommit();
|
2008-05-20 13:11:30 +00:00
|
|
|
|
|
|
|
Sequence<OUString> aNames(1);
|
2012-12-28 02:19:28 +01:00
|
|
|
aNames[0] = "Executable";
|
2008-05-20 13:11:30 +00:00
|
|
|
Sequence<Any> aValues(1);
|
|
|
|
aValues[0] <<= bLoadExecutable;
|
|
|
|
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtCalcFilterOptions_Impl::Load()
|
|
|
|
{
|
|
|
|
SvtAppFilterOptions_Impl::Load();
|
|
|
|
|
|
|
|
Sequence<OUString> aNames(1);
|
2012-12-28 02:19:28 +01:00
|
|
|
aNames[0] = "Executable";
|
2008-05-20 13:11:30 +00:00
|
|
|
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
if(pValues[0].hasValue())
|
2015-03-28 19:08:13 +01:00
|
|
|
bLoadExecutable = *static_cast<sal_Bool const *>(pValues[0].getValue());
|
2008-05-20 13:11:30 +00:00
|
|
|
}
|
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
struct SvtFilterOptions_Impl
|
|
|
|
{
|
2011-01-12 16:24:50 +01:00
|
|
|
sal_uLong nFlags;
|
2010-10-06 10:16:39 +01:00
|
|
|
SvtWriterFilterOptions_Impl aWriterCfg;
|
2008-09-04 09:02:04 +00:00
|
|
|
SvtCalcFilterOptions_Impl aCalcCfg;
|
|
|
|
SvtAppFilterOptions_Impl aImpressCfg;
|
2004-02-03 19:46:36 +00:00
|
|
|
|
|
|
|
SvtFilterOptions_Impl() :
|
2012-12-28 02:19:28 +01:00
|
|
|
aWriterCfg("Office.Writer/Filter/Import/VBA"),
|
|
|
|
aCalcCfg("Office.Calc/Filter/Import/VBA"),
|
|
|
|
aImpressCfg("Office.Impress/Filter/Import/VBA")
|
2008-09-04 09:02:04 +00:00
|
|
|
{
|
|
|
|
nFlags = FILTERCFG_WORD_CODE |
|
|
|
|
FILTERCFG_WORD_STORAGE |
|
|
|
|
FILTERCFG_EXCEL_CODE |
|
|
|
|
FILTERCFG_EXCEL_STORAGE |
|
|
|
|
FILTERCFG_PPOINT_CODE |
|
|
|
|
FILTERCFG_PPOINT_STORAGE |
|
|
|
|
FILTERCFG_MATH_LOAD |
|
|
|
|
FILTERCFG_MATH_SAVE |
|
|
|
|
FILTERCFG_WRITER_LOAD |
|
|
|
|
FILTERCFG_WRITER_SAVE |
|
|
|
|
FILTERCFG_CALC_LOAD |
|
|
|
|
FILTERCFG_CALC_SAVE |
|
|
|
|
FILTERCFG_IMPRESS_LOAD |
|
|
|
|
FILTERCFG_IMPRESS_SAVE |
|
2013-10-01 10:59:01 +02:00
|
|
|
FILTERCFG_USE_ENHANCED_FIELDS |
|
2015-03-18 10:30:18 +01:00
|
|
|
FILTERCFG_SMARTART_SHAPE_LOAD |
|
|
|
|
FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING;
|
2008-09-04 09:02:04 +00:00
|
|
|
Load();
|
|
|
|
}
|
2004-02-03 19:46:36 +00:00
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SetFlag( sal_uLong nFlag, bool bSet );
|
|
|
|
bool IsFlag( sal_uLong nFlag ) const;
|
2008-09-04 09:02:04 +00:00
|
|
|
void Load()
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
aWriterCfg.Load();
|
|
|
|
aCalcCfg.Load();
|
|
|
|
aImpressCfg.Load();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions_Impl::SetFlag( sal_uLong nFlag, bool bSet )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
switch(nFlag)
|
|
|
|
{
|
|
|
|
case FILTERCFG_WORD_CODE: aWriterCfg.SetLoad(bSet);break;
|
|
|
|
case FILTERCFG_WORD_STORAGE: aWriterCfg.SetSave(bSet);break;
|
2010-10-06 10:16:39 +01:00
|
|
|
case FILTERCFG_WORD_WBCTBL: aWriterCfg.SetLoadExecutable(bSet);break;
|
2004-02-03 19:46:36 +00:00
|
|
|
case FILTERCFG_EXCEL_CODE: aCalcCfg.SetLoad(bSet);break;
|
|
|
|
case FILTERCFG_EXCEL_STORAGE: aCalcCfg.SetSave(bSet);break;
|
2008-05-20 13:11:30 +00:00
|
|
|
case FILTERCFG_EXCEL_EXECTBL: aCalcCfg.SetLoadExecutable(bSet);break;
|
2004-02-03 19:46:36 +00:00
|
|
|
case FILTERCFG_PPOINT_CODE: aImpressCfg.SetLoad(bSet);break;
|
|
|
|
case FILTERCFG_PPOINT_STORAGE: aImpressCfg.SetSave(bSet);break;
|
|
|
|
default:
|
|
|
|
if( bSet )
|
|
|
|
nFlags |= nFlag;
|
|
|
|
else
|
|
|
|
nFlags &= ~nFlag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
2014-02-19 12:30:34 +01:00
|
|
|
bool bRet;
|
2004-02-03 19:46:36 +00:00
|
|
|
switch(nFlag)
|
|
|
|
{
|
|
|
|
case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
|
|
|
|
case FILTERCFG_WORD_STORAGE : bRet = aWriterCfg.IsSave();break;
|
2010-10-06 10:16:39 +01:00
|
|
|
case FILTERCFG_WORD_WBCTBL : bRet = aWriterCfg.IsLoadExecutable();break;
|
2004-02-03 19:46:36 +00:00
|
|
|
case FILTERCFG_EXCEL_CODE : bRet = aCalcCfg.IsLoad();break;
|
|
|
|
case FILTERCFG_EXCEL_STORAGE : bRet = aCalcCfg.IsSave();break;
|
2008-05-20 13:11:30 +00:00
|
|
|
case FILTERCFG_EXCEL_EXECTBL : bRet = aCalcCfg.IsLoadExecutable();break;
|
2004-02-03 19:46:36 +00:00
|
|
|
case FILTERCFG_PPOINT_CODE : bRet = aImpressCfg.IsLoad();break;
|
|
|
|
case FILTERCFG_PPOINT_STORAGE : bRet = aImpressCfg.IsSave();break;
|
|
|
|
default:
|
|
|
|
bRet = 0 != (nFlags & nFlag );
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
SvtFilterOptions::SvtFilterOptions() :
|
2012-12-28 02:19:28 +01:00
|
|
|
ConfigItem( "Office.Common/Filter/Microsoft" ),
|
2004-02-03 19:46:36 +00:00
|
|
|
pImp(new SvtFilterOptions_Impl)
|
|
|
|
{
|
|
|
|
EnableNotification(GetPropertyNames());
|
|
|
|
Load();
|
|
|
|
}
|
2011-08-11 21:52:01 +01:00
|
|
|
|
2004-02-03 19:46:36 +00:00
|
|
|
SvtFilterOptions::~SvtFilterOptions()
|
|
|
|
{
|
|
|
|
delete pImp;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
|
|
|
|
{
|
|
|
|
static Sequence<OUString> aNames;
|
|
|
|
if(!aNames.getLength())
|
|
|
|
{
|
2015-03-18 10:30:18 +01:00
|
|
|
int nCount = 14;
|
2004-02-03 19:46:36 +00:00
|
|
|
aNames.realloc(nCount);
|
|
|
|
static const char* aPropNames[] =
|
|
|
|
{
|
|
|
|
"Import/MathTypeToMath", // 0
|
|
|
|
"Import/WinWordToWriter", // 1
|
|
|
|
"Import/PowerPointToImpress", // 2
|
|
|
|
"Import/ExcelToCalc", // 3
|
|
|
|
"Export/MathToMathType", // 4
|
|
|
|
"Export/WriterToWinWord", // 5
|
|
|
|
"Export/ImpressToPowerPoint", // 6
|
2008-06-09 14:34:27 +00:00
|
|
|
"Export/CalcToExcel", // 7
|
|
|
|
"Export/EnablePowerPointPreview", // 8
|
|
|
|
"Export/EnableExcelPreview", // 9
|
2008-09-04 09:02:04 +00:00
|
|
|
"Export/EnableWordPreview", // 10
|
2013-10-01 10:59:01 +02:00
|
|
|
"Import/ImportWWFieldsAsEnhancedFields", // 11
|
2015-03-18 10:30:18 +01:00
|
|
|
"Import/SmartArtToShapes", // 12
|
|
|
|
"Export/CharBackgroundToHighlighting" // 13
|
2004-02-03 19:46:36 +00:00
|
|
|
};
|
|
|
|
OUString* pNames = aNames.getArray();
|
|
|
|
for(int i = 0; i < nCount; i++)
|
2010-12-22 16:20:58 +00:00
|
|
|
pNames[i] = OUString::createFromAscii(aPropNames[i]);
|
2004-02-03 19:46:36 +00:00
|
|
|
}
|
|
|
|
return aNames;
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2011-01-12 16:24:50 +01:00
|
|
|
static sal_uLong lcl_GetFlag(sal_Int32 nProp)
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
2011-01-12 16:24:50 +01:00
|
|
|
sal_uLong nFlag = 0;
|
2004-02-03 19:46:36 +00:00
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: nFlag = FILTERCFG_MATH_LOAD; break;
|
|
|
|
case 1: nFlag = FILTERCFG_WRITER_LOAD; break;
|
|
|
|
case 2: nFlag = FILTERCFG_IMPRESS_LOAD; break;
|
|
|
|
case 3: nFlag = FILTERCFG_CALC_LOAD; break;
|
|
|
|
case 4: nFlag = FILTERCFG_MATH_SAVE; break;
|
|
|
|
case 5: nFlag = FILTERCFG_WRITER_SAVE; break;
|
|
|
|
case 6: nFlag = FILTERCFG_IMPRESS_SAVE; break;
|
|
|
|
case 7: nFlag = FILTERCFG_CALC_SAVE; break;
|
2008-06-09 14:34:27 +00:00
|
|
|
case 8: nFlag = FILTERCFG_ENABLE_PPT_PREVIEW; break;
|
|
|
|
case 9: nFlag = FILTERCFG_ENABLE_EXCEL_PREVIEW; break;
|
|
|
|
case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break;
|
2008-09-04 09:02:04 +00:00
|
|
|
case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break;
|
2013-10-01 10:59:01 +02:00
|
|
|
case 12: nFlag = FILTERCFG_SMARTART_SHAPE_LOAD; break;
|
2015-03-18 10:30:18 +01:00
|
|
|
case 13: nFlag = FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING; break;
|
2008-06-09 14:34:27 +00:00
|
|
|
|
2011-03-01 19:08:19 +01:00
|
|
|
default: OSL_FAIL("illegal value");
|
2004-02-03 19:46:36 +00:00
|
|
|
}
|
|
|
|
return nFlag;
|
|
|
|
}
|
|
|
|
|
2006-06-19 19:43:34 +00:00
|
|
|
void SvtFilterOptions::Notify( const Sequence<OUString>& )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
Load();
|
|
|
|
}
|
|
|
|
|
2015-03-11 16:14:47 +01:00
|
|
|
void SvtFilterOptions::ImplCommit()
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
const Sequence<OUString>& aNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
|
|
|
|
2015-04-01 08:43:09 +02:00
|
|
|
const Type& rType = cppu::UnoType<bool>::get();
|
2004-02-03 19:46:36 +00:00
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
2011-01-12 16:24:50 +01:00
|
|
|
sal_uLong nFlag = lcl_GetFlag(nProp);
|
2004-02-03 19:46:36 +00:00
|
|
|
sal_Bool bVal = pImp->IsFlag( nFlag);
|
|
|
|
pValues[nProp].setValue(&bVal, rType);
|
|
|
|
|
|
|
|
}
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtFilterOptions::Load()
|
|
|
|
{
|
|
|
|
pImp->Load();
|
|
|
|
const Sequence<OUString>& rNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues = GetProperties(rNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
2008-11-10 15:06:12 +00:00
|
|
|
DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
|
2004-02-03 19:46:36 +00:00
|
|
|
if(aValues.getLength() == rNames.getLength())
|
|
|
|
{
|
|
|
|
for(int nProp = 0; nProp < rNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
if(pValues[nProp].hasValue())
|
|
|
|
{
|
2015-03-28 19:08:13 +01:00
|
|
|
bool bVal = *static_cast<sal_Bool const *>(pValues[nProp].getValue());
|
2011-01-12 16:24:50 +01:00
|
|
|
sal_uLong nFlag = lcl_GetFlag(nProp);
|
2004-02-03 19:46:36 +00:00
|
|
|
pImp->SetFlag( nFlag, bVal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadWordBasicCode( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_WORD_CODE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadWordBasicCode() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_WORD_CODE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadWordBasicExecutable( bool bFlag )
|
2010-10-06 10:16:39 +01:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadWordBasicExecutable() const
|
2010-10-06 10:16:39 +01:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_WORD_WBCTBL );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadWordBasicStorage( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadWordBasicStorage() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_WORD_STORAGE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadExcelBasicCode( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_EXCEL_CODE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadExcelBasicCode() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_EXCEL_CODE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadExcelBasicExecutable( bool bFlag )
|
2008-05-20 13:11:30 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadExcelBasicExecutable() const
|
2008-05-20 13:11:30 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_EXCEL_EXECTBL );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadExcelBasicStorage( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadExcelBasicStorage() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_EXCEL_STORAGE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadPPointBasicCode( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_PPOINT_CODE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadPPointBasicCode() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_PPOINT_CODE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetLoadPPointBasicStorage( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsLoadPPointBasicStorage() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_PPOINT_STORAGE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsMathType2Math() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_MATH_LOAD );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetMathType2Math( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_MATH_LOAD, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsMath2MathType() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_MATH_SAVE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetMath2MathType( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_MATH_SAVE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsWinWord2Writer() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_WRITER_LOAD );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetWinWord2Writer( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_WRITER_LOAD, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsWriter2WinWord() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_WRITER_SAVE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetWriter2WinWord( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_WRITER_SAVE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsUseEnhancedFields() const
|
2008-09-04 09:02:04 +00:00
|
|
|
{
|
2010-09-14 15:56:15 +02:00
|
|
|
return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
|
2008-09-04 09:02:04 +00:00
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsExcel2Calc() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_CALC_LOAD );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetExcel2Calc( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_CALC_LOAD, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsCalc2Excel() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_CALC_SAVE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetCalc2Excel( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_CALC_SAVE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsPowerPoint2Impress() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_IMPRESS_LOAD );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetPowerPoint2Impress( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsImpress2PowerPoint() const
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_IMPRESS_SAVE );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetImpress2PowerPoint( bool bFlag )
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsSmartArt2Shape() const
|
2013-10-01 10:59:01 +02:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_SMARTART_SHAPE_LOAD );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
void SvtFilterOptions::SetSmartArt2Shape( bool bFlag )
|
2013-10-01 10:59:01 +02:00
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_SMARTART_SHAPE_LOAD, bFlag );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2011-08-11 21:52:01 +01:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
class theFilterOptions
|
|
|
|
: public rtl::Static<SvtFilterOptions, theFilterOptions>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
SvtFilterOptions& SvtFilterOptions::Get()
|
2004-02-03 19:46:36 +00:00
|
|
|
{
|
2011-08-11 21:52:01 +01:00
|
|
|
return theFilterOptions::get();
|
2004-02-03 19:46:36 +00:00
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsEnablePPTPreview() const
|
2008-06-09 14:34:27 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsEnableCalcPreview() const
|
2008-06-09 14:34:27 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW );
|
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool SvtFilterOptions::IsEnableWordPreview() const
|
2008-06-09 14:34:27 +00:00
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW );
|
|
|
|
}
|
|
|
|
|
2015-03-18 10:30:18 +01:00
|
|
|
|
|
|
|
bool SvtFilterOptions::IsCharBackground2Highlighting() const
|
|
|
|
{
|
|
|
|
return pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SvtFilterOptions::IsCharBackground2Shading() const
|
|
|
|
{
|
|
|
|
return !pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtFilterOptions::SetCharBackground2Highlighting()
|
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, true );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtFilterOptions::SetCharBackground2Shading()
|
|
|
|
{
|
|
|
|
pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, false );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|