Files
libreoffice/xmloff/source/style/xmlexppr.cxx

1063 lines
38 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by: Armin Le Grand. #118558# Correcting OLE attributes of LO3.4 at load time by loading as OOo3.3, details see task. http://svn.apache.org/viewvc?view=revision&revision=1195906 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles http://svn.apache.org/viewvc?view=revision&revision=1293316 #119337# Solves the wrong get/setPropertyValue calls in SvxShapeText (and thus in SvxOle2Shape) http://svn.apache.org/viewvc?view=revision&revision=1344156 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117717#: remove wrong assertion http://svn.apache.org/viewvc?view=revision&revision=1172349 Patch contributed by Herbert Duerr goodbye Registration and License dialogs, don't let the door hit you http://svn.apache.org/viewvc?view=revision&revision=1172613 help gcc 4.6.0 on 32bit ubuntu 11.10" http://svn.apache.org/viewvc?view=revision&revision=1245357 Do not add targets for junit tests when junit is disabled. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1241508 Revert "sb140: #i117082# avoid unncessary static class data members commit 21d97438e2944861e26e4984195f959a0cce1e41. remove obsolete FreeBSD visibility special case. retain consolidated BSD bridge code, remove OS/2 pieces.
2012-11-12 17:21:24 +00: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 .
*/
2000-09-18 16:07:07 +00:00
2000-10-20 13:53:32 +00:00
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/xml/AttributeData.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
2000-10-20 13:53:32 +00:00
#include <rtl/ustrbuf.hxx>
#include <list>
#include <map>
2000-10-20 13:53:32 +00:00
#include <xmloff/xmlexppr.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmlprmap.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/xmltypes.hxx>
#include <xmloff/xmlprhdl.hxx>
using namespace ::std;
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::xmloff::token;
2000-09-18 16:07:07 +00:00
#define GET_PROP_TYPE( f ) static_cast<sal_uInt16>((f & XML_TYPE_PROP_MASK) >> XML_TYPE_PROP_SHIFT)
#define ENTRY(t) { GET_PROP_TYPE(XML_TYPE_PROP_##t), XML_##t##_PROPERTIES }
namespace {
struct XMLPropTokens_Impl
{
sal_uInt16 nType;
XMLTokenEnum eToken;
};
const sal_uInt16 MAX_PROP_TYPES =
(XML_TYPE_PROP_END >> XML_TYPE_PROP_SHIFT) -
(XML_TYPE_PROP_START >> XML_TYPE_PROP_SHIFT);
XMLPropTokens_Impl aPropTokens[MAX_PROP_TYPES] =
{
ENTRY(CHART),
ENTRY(GRAPHIC),
ENTRY(TABLE),
ENTRY(TABLE_COLUMN),
ENTRY(TABLE_ROW),
ENTRY(TABLE_CELL),
ENTRY(LIST_LEVEL),
ENTRY(PARAGRAPH),
ENTRY(TEXT),
ENTRY(DRAWING_PAGE),
ENTRY(PAGE_LAYOUT),
ENTRY(HEADER_FOOTER),
ENTRY(RUBY),
ENTRY(SECTION)
};
2000-09-18 16:07:07 +00:00
// public methods
// Take all properties of the XPropertySet which are also found in the
// XMLPropertyMapEntry-array and which are not set to their default-value,
// if a state is available.
// After that I call the method 'ContextFilter'.
typedef std::list<XMLPropertyState> XMLPropertyStateList_Impl;
class XMLPropertyStates_Impl
{
XMLPropertyStateList_Impl aPropStates;
XMLPropertyStateList_Impl::iterator aLastItr;
sal_uInt32 nCount;
public:
XMLPropertyStates_Impl();
void AddPropertyState(const XMLPropertyState& rPropState);
void FillPropertyStateVector(std::vector<XMLPropertyState>& rVector);
};
XMLPropertyStates_Impl::XMLPropertyStates_Impl() :
aPropStates(),
nCount(0)
{
aLastItr = aPropStates.begin();
}
void XMLPropertyStates_Impl::AddPropertyState(
const XMLPropertyState& rPropState)
{
XMLPropertyStateList_Impl::iterator aItr = aPropStates.begin();
bool bInserted(false);
if (nCount)
{
if (aLastItr->mnIndex < rPropState.mnIndex)
aItr = ++aLastItr;
}
do
{
// TODO: one path required only
if (aItr == aPropStates.end())
{
aLastItr = aPropStates.insert(aPropStates.end(), rPropState);
bInserted = true;
nCount++;
}
else if (aItr->mnIndex > rPropState.mnIndex)
{
aLastItr = aPropStates.insert(aItr, rPropState);
bInserted = true;
nCount++;
}
}
while(!bInserted && (aItr++ != aPropStates.end()));
}
void XMLPropertyStates_Impl::FillPropertyStateVector(
std::vector<XMLPropertyState>& rVector)
{
if (nCount)
{
rVector.resize(nCount, XMLPropertyState(-1));
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
::std::copy( aPropStates.begin(), aPropStates.end(), rVector.begin() );
}
}
class FilterPropertyInfo_Impl
{
const OUString sApiName;
std::list<sal_uInt32> aIndexes;
public:
FilterPropertyInfo_Impl( const OUString& rApiName,
const sal_uInt32 nIndex);
const OUString& GetApiName() const { return sApiName; }
std::list<sal_uInt32>& GetIndexes() { return aIndexes; }
// for sort
bool operator< ( const FilterPropertyInfo_Impl& rArg ) const
{
return (GetApiName() < rArg.GetApiName());
}
};
FilterPropertyInfo_Impl::FilterPropertyInfo_Impl(
const OUString& rApiName,
const sal_uInt32 nIndex ) :
sApiName( rApiName )
{
aIndexes.push_back(nIndex);
}
typedef std::list<FilterPropertyInfo_Impl> FilterPropertyInfoList_Impl;
2001-04-19 12:52:21 +00:00
class FilterPropertiesInfo_Impl
{
sal_uInt32 nCount;
FilterPropertyInfoList_Impl aPropInfos;
FilterPropertyInfoList_Impl::iterator aLastItr;
Sequence <OUString> *pApiNames;
public:
FilterPropertiesInfo_Impl();
~FilterPropertiesInfo_Impl();
void AddProperty(const OUString& rApiName, const sal_uInt32 nIndex);
const uno::Sequence<OUString>& GetApiNames();
void FillPropertyStateArray(
vector< XMLPropertyState >& rPropStates,
const Reference< XPropertySet >& xPropSet,
const rtl::Reference< XMLPropertySetMapper >& maPropMapper,
const bool bDefault = false);
sal_uInt32 GetPropertyCount() const { return nCount; }
};
2001-04-19 12:52:21 +00:00
FilterPropertiesInfo_Impl::FilterPropertiesInfo_Impl() :
nCount(0),
aPropInfos(),
pApiNames( 0 )
{
aLastItr = aPropInfos.begin();
}
FilterPropertiesInfo_Impl::~FilterPropertiesInfo_Impl()
{
delete pApiNames;
}
void FilterPropertiesInfo_Impl::AddProperty(
const OUString& rApiName, const sal_uInt32 nIndex)
{
aPropInfos.push_back(FilterPropertyInfo_Impl(rApiName, nIndex));
nCount++;
Many spelling fixes: directories r* - z*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit 28206a7cb43aff5adb10f8235ad1680c3941ee3e) Conflicts: include/osl/file.hxx include/osl/pipe_decl.hxx include/osl/socket.h include/osl/socket_decl.hxx include/sal/main.h include/svx/dbaexchange.hxx include/svx/dlgctrl.hxx include/svx/msdffdef.hxx include/svx/sdr/contact/objectcontactofpageview.hxx include/svx/svdpntv.hxx include/ucbhelper/content.hxx include/ucbhelper/interceptedinteraction.hxx include/ucbhelper/resultsethelper.hxx include/unotools/sharedunocomponent.hxx include/unotools/viewoptions.hxx include/vcl/pdfwriter.hxx include/xmloff/txtparae.hxx include/xmloff/uniref.hxx rhino/rhino1_7R3.patch rsc/inc/rscrsc.hxx sal/inc/osl/conditn.h sal/inc/osl/security.h sal/inc/osl/semaphor.h sal/inc/osl/semaphor.hxx sal/inc/rtl/string.hxx sal/inc/rtl/tres.h sal/inc/systools/win32/StrConvert.h sal/osl/os2/file_path_helper.h sal/osl/os2/file_path_helper.hxx sal/osl/os2/file_url.cxx sal/osl/os2/file_url.h sal/osl/os2/makefile.mk sal/osl/os2/pipe.cxx sal/osl/os2/process.c sal/osl/os2/profile.c sal/osl/os2/socket.c sal/osl/os2/system.h sal/osl/unx/asm/interlck_sparc.s sal/osl/unx/file_url.cxx sal/osl/unx/signal.c sal/osl/unx/system.h sal/osl/w32/MAKEFILE.MK sal/osl/w32/interlck.c sal/osl/w32/module.cxx sal/osl/w32/security.c sal/qa/buildall.pl sal/qa/osl/file/osl_File.cxx sal/qa/osl/module/osl_Module_Const.h sal/qa/osl/mutex/osl_Mutex.cxx sal/qa/osl/pipe/osl_Pipe.cxx sal/qa/osl/process/osl_Thread.cxx sal/qa/osl/socket/osl_StreamSocket.cxx sal/qa/osl/socket/sockethelper.cxx sal/qa/rtl_strings/rtl_OUString.cxx sal/rtl/source/unload.cxx sal/systools/win32/kill/kill.cxx sal/systools/win32/uwinapi/MoveFileExA.cpp sal/test/bootstrap.pl sal/typesconfig/typesconfig.c sal/workben/tgetpwnam.cxx sax/inc/sax/parser/saxparser.hxx sc/addin/datefunc/dfa.cl sc/addin/datefunc/dfa.src sc/addin/rot13/rot13.cl sc/addin/rot13/rot13.src sc/inc/attarray.hxx sc/inc/chgtrack.hxx sc/inc/column.hxx sc/inc/compressedarray.hxx sc/inc/document.hxx sc/inc/table.hxx sc/source/core/data/column.cxx sc/source/core/data/dptablecache.cxx sc/source/core/data/dptabres.cxx sc/source/core/data/dptabsrc.cxx sc/source/core/data/global.cxx sc/source/core/tool/chgtrack.cxx sc/source/core/tool/compiler.cxx sc/source/filter/excel/xestyle.cxx sc/source/filter/excel/xichart.cxx sc/source/filter/inc/fapihelper.hxx sc/source/filter/inc/xistyle.hxx sc/source/filter/xml/xmlsubti.cxx sc/source/ui/Accessibility/AccessibleCell.cxx sc/source/ui/Accessibility/AccessibleContextBase.cxx sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx sc/source/ui/Accessibility/AccessibleEditObject.cxx sc/source/ui/Accessibility/AccessiblePreviewCell.cxx sc/source/ui/app/inputwin.cxx sc/source/ui/docshell/docfunc.cxx sc/source/ui/drawfunc/fupoor.cxx sc/source/ui/miscdlgs/linkarea.cxx sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/nameuno.cxx sc/source/ui/vba/vbacharacters.hxx sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbawindow.cxx scaddins/source/analysis/analysishelper.cxx scaddins/source/analysis/analysishelper.hxx scaddins/source/datefunc/datefunc.cxx scripting/examples/python/Capitalise.py scripting/source/pyprov/officehelper.py sd/source/filter/eppt/eppt.cxx sd/source/filter/eppt/epptso.cxx sd/source/ui/dlg/prltempl.cxx sd/source/ui/dlg/tpoption.cxx sd/source/ui/func/fuediglu.cxx sd/source/ui/func/fupoor.cxx sd/source/ui/func/fusel.cxx sd/source/ui/func/smarttag.cxx sd/source/ui/inc/OutlinerIteratorImpl.hxx sd/source/ui/inc/SlideViewShell.hxx sd/source/ui/inc/fuediglu.hxx sd/source/ui/inc/fusel.hxx sd/source/ui/slideshow/slideshowimpl.cxx sd/source/ui/slidesorter/cache/SlsQueueProcessorThread.hxx sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx sd/source/ui/slidesorter/controller/SlsSelectionCommand.hxx sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx sd/source/ui/slidesorter/view/SlsButtonBar.cxx sd/source/ui/view/Outliner.cxx sd/source/ui/view/drviewsh.cxx sd/source/ui/view/frmview.cxx sdext/source/presenter/PresenterFrameworkObserver.hxx sdext/source/presenter/PresenterSlideShowView.cxx setup_native/scripts/deregister_extensions setup_native/scripts/register_extensions setup_native/source/opensolaris/bundledextensions/README setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions setup_native/source/win32/customactions/patch/swappatchfiles.cxx setup_native/source/win32/customactions/reg4msdoc/registrar.cxx setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx sfx2/inc/sfx2/sfxbasemodel.hxx sfx2/qa/complex/sfx2/DocumentProperties.java sfx2/source/appl/appopen.cxx sfx2/source/appl/appquit.cxx sfx2/source/appl/appserv.cxx sfx2/source/bastyp/sfxhtml.cxx sfx2/source/dialog/dockwin.cxx sfx2/source/doc/docfile.cxx sfx2/source/doc/docvor.cxx sfx2/source/doc/graphhelp.cxx sfx2/source/doc/objcont.cxx sfx2/source/doc/objserv.cxx sfx2/source/doc/objstor.cxx sfx2/source/doc/objuno.cxx sfx2/source/doc/objxtor.cxx sfx2/source/doc/printhelper.cxx sfx2/source/doc/sfxbasemodel.cxx sfx2/source/notify/eventsupplier.cxx sfx2/source/view/frmload.cxx sfx2/source/view/sfxbasecontroller.cxx shell/qa/zip/ziptest.cxx shell/source/backends/wininetbe/wininetbackend.cxx shell/source/win32/shlxthandler/util/utilities.cxx solenv/bin/build.pl solenv/bin/build_release.pl solenv/bin/cws.pl solenv/bin/download_external_dependencies.pl solenv/bin/make_download.pl solenv/bin/make_installer.pl solenv/bin/modules/Cws.pm solenv/bin/modules/ExtensionsLst.pm solenv/bin/modules/installer/control.pm solenv/bin/modules/installer/downloadsigner.pm solenv/bin/modules/installer/javainstaller.pm solenv/bin/modules/installer/packagepool.pm solenv/bin/modules/installer/patch/InstallationSet.pm solenv/bin/modules/installer/scriptitems.pm solenv/bin/modules/installer/windows/feature.pm solenv/bin/modules/installer/windows/msiglobal.pm solenv/bin/modules/installer/windows/sign.pm solenv/bin/modules/installer/worker.pm solenv/bin/modules/installer/xpdinstaller.pm solenv/bin/modules/osarch.pm solenv/bin/modules/packager/work.pm solenv/bin/modules/pre2par/parameter.pm solenv/bin/patch_tool.pl solenv/bin/transform_description.pl solenv/doc/gbuild/doxygen.cfg solenv/gbuild/LinkTarget.mk solenv/gbuild/gbuild.mk solenv/inc/os2gcci.mk solenv/inc/settings.mk solenv/inc/startup/Readme solenv/inc/target.mk solenv/inc/tg_compv.mk solenv/inc/tg_javav.mk solenv/inc/unitools.mk solenv/inc/unxbsdi.mk solenv/inc/unxbsdi2.mk solenv/inc/unxbsds.mk solenv/inc/unxfbsd.mk solenv/inc/unxlng.mk sot/source/sdstor/stg.cxx sot/source/sdstor/stgelem.cxx sot/source/sdstor/ucbstorage.cxx starmath/inc/toolbox.hxx starmath/source/mathmlexport.cxx starmath/source/node.cxx starmath/source/toolbox.cxx starmath/source/view.cxx stoc/source/bootstrap/bootstrap.xml stoc/source/corereflection/criface.cxx stoc/source/invocation/invocation.cxx stoc/source/security/access_controller.cxx stoc/source/servicemanager/servicemanager.cxx stoc/source/tdmanager/tdmgr.cxx stoc/test/javavm/testjavavm.cxx stoc/test/testconv.cxx stoc/test/testcorefl.cxx stoc/test/testintrosp.cxx svl/inc/svl/inettype.hxx svl/inc/svl/urihelper.hxx svl/qa/complex/ConfigItems/helper/HistoryOptTest.cxx svl/qa/complex/ConfigItems/helper/HistoryOptTest.hxx svl/source/config/itemholder2.hxx svl/source/items/itemset.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svtools/bmpmaker/bmp.cxx svtools/inc/svtools/helpagentwindow.hxx svtools/inc/svtools/menuoptions.hxx svtools/inc/svtools/miscopt.hxx svtools/inc/svtools/optionsdrawinglayer.hxx svtools/inc/svtools/stringtransfer.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svtdata.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/editbrowsebox.cxx svtools/source/config/itemholder2.hxx svtools/source/contnr/contentenumeration.hxx svx/inc/svx/fmsrcimp.hxx svx/inc/svx/svdobj.hxx svx/inc/svx/xtable.hxx svx/source/accessibility/DGColorNameLookUp.cxx svx/source/accessibility/svxrectctaccessiblecontext.cxx svx/source/dialog/pfiledlg.cxx svx/source/fmcomp/fmgridcl.cxx svx/source/fmcomp/fmgridif.cxx svx/source/fmcomp/gridctrl.cxx svx/source/form/filtnav.cxx svx/source/form/fmPropBrw.cxx svx/source/form/fmshimp.cxx svx/source/form/fmsrcimp.cxx svx/source/gallery2/galtheme.cxx svx/source/inc/docrecovery.hxx svx/source/sdr/event/eventhandler.cxx svx/source/svdraw/svdedtv2.cxx svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdhdl.cxx svx/source/svdraw/svdobj.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdoole2.cxx svx/source/svdraw/svdotxtr.cxx svx/source/svdraw/svdundo.cxx svx/source/svdraw/svdxcgv.cxx svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx sw/inc/SwNumberTree.hxx sw/inc/ndnotxt.hxx sw/source/core/access/acccell.cxx sw/source/core/access/acccell.hxx sw/source/core/access/accframebase.cxx sw/source/core/access/accframebase.hxx sw/source/core/access/accmap.cxx sw/source/core/access/accpage.cxx sw/source/core/access/accpage.hxx sw/source/core/access/accpara.cxx sw/source/core/access/accpara.hxx sw/source/core/bastyp/swrect.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/doc/docdde.cxx sw/source/core/doc/notxtfrm.cxx sw/source/core/docnode/section.cxx sw/source/core/draw/dcontact.cxx sw/source/core/edit/edlingu.cxx sw/source/core/inc/anchoredobjectposition.hxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/ole/ndole.cxx sw/source/core/text/atrstck.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/itratr.cxx sw/source/core/text/itrform2.cxx sw/source/core/text/itrform2.hxx sw/source/core/text/porfld.cxx sw/source/core/text/txtfly.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/uibase/dochdl/swdtflvr.cxx sw/source/core/uibase/docvw/PostItMgr.cxx sw/source/core/uibase/docvw/SidebarWin.cxx sw/source/core/uibase/docvw/edtwin.cxx sw/source/core/uibase/envelp/labimg.cxx sw/source/core/uibase/uiview/pview.cxx sw/source/core/uibase/uno/unomailmerge.cxx sw/source/core/undo/unattr.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/unochart.cxx sw/source/core/view/vdraw.cxx sw/source/core/view/vnew.cxx sw/source/filter/basflt/fltini.cxx sw/source/filter/html/wrthtml.cxx sw/source/filter/inc/wwstyles.hxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/rtf/swparrtf.cxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/dump/msvbasic.cxx sw/source/filter/ww8/dump/ww8scan.cxx sw/source/filter/ww8/dump/ww8scan.hxx sw/source/filter/ww8/dump/ww8struc.hxx sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/ww8graf.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par2.cxx sw/source/filter/ww8/ww8par2.hxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8scan.cxx sw/source/filter/ww8/ww8scan.hxx sw/source/ui/dbui/dbinsdlg.cxx sw/source/ui/inc/tablemgr.hxx sw/source/ui/inc/uitool.hxx sw/source/ui/lingu/olmenu.cxx sw/source/ui/uiview/viewport.cxx sysui/desktop/productversion.mk sysui/desktop/slackware/makefile.mk testgraphical/source/CallExternals.pm testgraphical/source/fill_documents_loop.pl testgraphical/ui/java/ConvwatchGUIProject/src/IniFile.java toolkit/doc/layout/notes.txt toolkit/doc/layout/oldnotes.txt toolkit/source/awt/vclxtabcontrol.cxx toolkit/src2xml/source/srcparser.py toolkit/workben/layout/editor.cxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/source/communi/geninfo.cxx tools/source/fsys/dirent.cxx tools/source/fsys/filecopy.cxx tools/source/fsys/os2.cxx tools/source/inet/inetmime.cxx tools/source/rc/resmgr.cxx ucb/source/core/ucbcmds.cxx ucb/source/ucp/file/filglob.cxx ucb/source/ucp/odma/odma_content.cxx ucb/source/ucp/tdoc/ucptdoc.xml ucb/source/ucp/webdav/makefile.mk ucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx ucbhelper/source/client/content.cxx ucbhelper/source/client/interceptedinteraction.cxx udkapi/com/sun/star/beans/XPropertiesChangeListener.idl udkapi/com/sun/star/io/ObjectOutputStream.idl udkapi/com/sun/star/io/XMarkableStream.idl udkapi/com/sun/star/io/XTextOutputStream.idl udkapi/com/sun/star/reflection/CoreReflection.idl udkapi/com/sun/star/reflection/XTypeDescriptionEnumerationAccess.idl udkapi/com/sun/star/test/XSimpleTest.idl unodevtools/source/skeletonmaker/skeletoncommon.cxx unodevtools/source/skeletonmaker/skeletoncommon.hxx unotools/inc/unotools/cacheoptions.hxx unotools/inc/unotools/cmdoptions.hxx unotools/inc/unotools/dynamicmenuoptions.hxx unotools/inc/unotools/extendedsecurityoptions.hxx unotools/inc/unotools/fontoptions.hxx unotools/inc/unotools/historyoptions.hxx unotools/inc/unotools/idhelper.hxx unotools/inc/unotools/internaloptions.hxx unotools/inc/unotools/localisationoptions.hxx unotools/inc/unotools/moduleoptions.hxx unotools/inc/unotools/printwarningoptions.hxx unotools/inc/unotools/securityoptions.hxx unotools/inc/unotools/startoptions.hxx unotools/inc/unotools/workingsetoptions.hxx unotools/source/config/cmdoptions.cxx unotools/source/config/compatibility.cxx unotools/source/config/configitem.cxx unotools/source/config/configmgr.cxx unotools/source/config/dynamicmenuoptions.cxx unotools/source/config/fontcfg.cxx unotools/source/config/itemholder1.hxx unotools/source/config/moduleoptions.cxx unotools/source/config/pathoptions.cxx unotools/source/config/viewoptions.cxx unotools/source/misc/sharedunocomponent.cxx uui/source/fltdlg.cxx uui/source/iahndl-filter.cxx vbahelper/inc/vbahelper/collectionbase.hxx vbahelper/source/msforms/vbacontrol.cxx vbahelper/source/vbahelper/collectionbase.cxx vcl/aqua/source/gdi/atsfonts.cxx vcl/inc/aqua/salmathutils.hxx vcl/inc/graphite_cache.hxx vcl/inc/jobset.h vcl/inc/os2/salgdi.h vcl/inc/osx/saldata.hxx vcl/inc/salgdi.hxx vcl/inc/salwtype.hxx vcl/inc/unx/wmadaptor.hxx vcl/inc/vcl/print.hxx vcl/inc/vcl/strhelper.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/app/saltimer.cxx vcl/os2/source/gdi/salgdi2.cxx vcl/osx/salframeview.mm vcl/osx/salprn.cxx vcl/qa/cppunit/dndtest.cxx vcl/source/app/dbggui.cxx vcl/source/control/ilstbox.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdev6.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/pdfwriter_impl2.cxx vcl/source/gdi/print.cxx vcl/source/gdi/print2.cxx vcl/source/glyphs/gcach_layout.cxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/window/printdlg.cxx vcl/source/window/tabdlg.cxx vcl/source/window/window.cxx vcl/source/window/winproc.cxx vcl/unx/generic/app/saldisp.cxx vcl/unx/generic/dtrans/X11_selection.hxx vcl/unx/gtk/app/gtkdata.cxx vcl/win/source/gdi/salgdi2.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/window/salframe.cxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/socket.cxx wizards/com/sun/star/wizards/agenda/AgendaTemplate.java wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java wizards/com/sun/star/wizards/agenda/TopicsControl.java wizards/com/sun/star/wizards/web/FTPDialog.java wizards/com/sun/star/wizards/web/ImageListDialog.java wizards/com/sun/star/wizards/web/Process.java wizards/com/sun/star/wizards/web/ProcessStatusRenderer.java wizards/com/sun/star/wizards/web/TOCPreview.java wizards/com/sun/star/wizards/web/WWD_Startup.java wizards/com/sun/star/wizards/web/data/TypeDetection.java wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java writerfilter/inc/doctok/WW8Document.hxx writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/NumberingManager.cxx writerfilter/source/dmapper/PropertyMap.cxx writerfilter/source/dmapper/StyleSheetTable.cxx writerfilter/source/doctok/WW8StructBase.hxx writerfilter/source/doctok/resources.xmi writerfilter/source/ooxml/README.efforts xmerge/source/activesync/XMergeFilter.cpp xmerge/source/minicalc/java/org/openoffice/xmerge/converter/xml/sxc/minicalc/SxcDocumentDeserializerImpl.java xmerge/source/palmtests/qa/comparator/pdbcomparison.java xmerge/source/palmtests/qa/test_spec/convertor_test_spec.html xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/DefinedName.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/Workbook.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/Worksheet.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/formula/SymbolLookup.java xmerge/source/pocketword/java/org/openoffice/xmerge/converter/xml/sxw/pocketword/DocumentDescriptor.java xmerge/workben/jstyle.pl xmlhelp/source/cxxhelp/provider/databases.hxx xmlhelp/source/cxxhelp/provider/provider.cxx xmlhelp/source/treeview/tvread.cxx xmloff/inc/txtfldi.hxx xmloff/inc/xmloff/xmlmultiimagehelper.hxx xmloff/inc/xmloff/xmluconv.hxx xmloff/source/core/xmlexp.cxx xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport3.cxx xmloff/source/meta/xmlversion.cxx xmloff/source/style/impastp4.cxx xmloff/source/style/xmlaustp.cxx xmloff/source/text/XMLSectionExport.cxx xmloff/source/text/txtflde.cxx xmloff/source/text/txtimp.cxx xmloff/source/text/txtparae.cxx xmloff/source/text/txtparai.cxx xmloff/source/text/txtvfldi.cxx xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx Change-Id: Ie072e7c3a60c5dae16a67ac36d1f372c5065c99c
2014-04-29 19:25:03 +00:00
OSL_ENSURE( !pApiNames, "performance warning: API names already retrieved" );
if( pApiNames )
{
delete pApiNames;
pApiNames = NULL;
}
}
const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
{
OSL_ENSURE(nCount == aPropInfos.size(), "wrong property count");
if( !pApiNames )
{
// we have to do three things:
// 1) sort API names,
// 2) merge duplicates,
// 3) construct sequence
// sort names
aPropInfos.sort();
// merge duplicates
if ( nCount > 1 )
{
FilterPropertyInfoList_Impl::iterator aOld = aPropInfos.begin();
FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
FilterPropertyInfoList_Impl::iterator aCurrent = aOld;
2010-12-19 16:36:43 +00:00
++aCurrent;
while ( aCurrent != aEnd )
{
// equal to next element?
if ( aOld->GetApiName().equals( aCurrent->GetApiName() ) )
{
// if equal: merge index lists
aOld->GetIndexes().merge( aCurrent->GetIndexes() );
// erase element, and continue with next
aCurrent = aPropInfos.erase( aCurrent );
nCount--;
}
else
{
// remember old element and continue with next
aOld = aCurrent;
2010-12-19 16:36:43 +00:00
++aCurrent;
}
}
}
// construct sequence
pApiNames = new Sequence < OUString >( nCount );
OUString *pNames = pApiNames->getArray();
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
2010-12-19 16:36:43 +00:00
for ( ; aItr != aEnd; ++aItr, ++pNames)
*pNames = aItr->GetApiName();
}
return *pApiNames;
}
void FilterPropertiesInfo_Impl::FillPropertyStateArray(
vector< XMLPropertyState >& rPropStates,
const Reference< XPropertySet >& rPropSet,
const rtl::Reference< XMLPropertySetMapper >& rPropMapper,
const bool bDefault )
{
XMLPropertyStates_Impl aPropStates;
2001-04-18 07:53:19 +00:00
const uno::Sequence<OUString>& rApiNames = GetApiNames();
Reference < XTolerantMultiPropertySet > xTolPropSet( rPropSet, UNO_QUERY );
if (xTolPropSet.is())
{
if (!bDefault)
{
Sequence < beans::GetDirectPropertyTolerantResult > aResults(xTolPropSet->getDirectPropertyValuesTolerant(rApiNames));
sal_Int32 nResultCount(aResults.getLength());
if (nResultCount > 0)
{
const beans::GetDirectPropertyTolerantResult *pResults = aResults.getConstArray();
FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
XMLPropertyState aNewProperty( -1 );
sal_uInt32 i = 0;
while (nResultCount > 0 && i < nCount)
{
if (pResults->Name == aPropIter->GetApiName())
{
aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value;
for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin());
aIndexItr != aPropIter->GetIndexes().end();
++aIndexItr )
{
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
++pResults;
--nResultCount;
}
++aPropIter;
++i;
}
}
}
else
{
Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames));
OSL_ENSURE( rApiNames.getLength() == aResults.getLength(), "wrong implemented XTolerantMultiPropertySet" );
const beans::GetPropertyTolerantResult *pResults = aResults.getConstArray();
FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
XMLPropertyState aNewProperty( -1 );
sal_uInt32 nResultCount(aResults.getLength());
OSL_ENSURE( nCount == nResultCount, "wrong implemented XTolerantMultiPropertySet??" );
for( sal_uInt32 i = 0; i < nResultCount; ++i )
2001-04-18 07:53:19 +00:00
{
if ((pResults->Result == beans::TolerantPropertySetResultType::SUCCESS) &&
((pResults->State == PropertyState_DIRECT_VALUE) || (pResults->State == PropertyState_DEFAULT_VALUE)))
{
aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value;
for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin());
aIndexItr != aPropIter->GetIndexes().end();
++aIndexItr )
{
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
}
++pResults;
++aPropIter;
2001-04-18 07:53:19 +00:00
}
}
}
else
{
Sequence < PropertyState > aStates;
const PropertyState *pStates = 0;
Reference< XPropertyState > xPropState( rPropSet, UNO_QUERY );
if( xPropState.is() )
{
aStates = xPropState->getPropertyStates( rApiNames );
pStates = aStates.getConstArray();
}
Reference < XMultiPropertySet > xMultiPropSet( rPropSet, UNO_QUERY );
if( xMultiPropSet.is() && !bDefault )
{
Sequence < Any > aValues;
if( pStates )
2001-04-18 07:53:19 +00:00
{
// step 1: get value count
sal_uInt32 nValueCount = 0;
sal_uInt32 i;
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
for( i = 0; i < nCount; ++i, ++pStates )
{
if( (*pStates == PropertyState_DIRECT_VALUE)/* || (bDefault && (*pStates == PropertyState_DEFAULT_VALUE))*/ )
nValueCount++;
}
if( nValueCount )
{
// step 2: collect property names
Sequence < OUString > aAPINames( nValueCount );
OUString *pAPINames = aAPINames.getArray();
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
::std::vector< FilterPropertyInfoList_Impl::iterator > aPropIters;
aPropIters.reserve( nValueCount );
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
OSL_ENSURE(aItr != aPropInfos.end(),"Invalid iterator!");
pStates = aStates.getConstArray();
i = 0;
while( i < nValueCount )
2001-04-18 07:53:19 +00:00
{
if( (*pStates == PropertyState_DIRECT_VALUE)/* || (bDefault && (*pStates == PropertyState_DEFAULT_VALUE))*/ )
{
*pAPINames++ = aItr->GetApiName();
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
aPropIters.push_back( aItr );
++i;
}
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
++aItr;
++pStates;
2001-04-18 07:53:19 +00:00
}
aValues = xMultiPropSet->getPropertyValues( aAPINames );
const Any *pValues = aValues.getConstArray();
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
::std::vector< FilterPropertyInfoList_Impl::iterator >::const_iterator
pPropIter = aPropIters.begin();
XMLPropertyState aNewProperty( -1 );
2010-12-19 16:36:43 +00:00
for( i = 0; i < nValueCount; ++i )
{
aNewProperty.mnIndex = -1;
aNewProperty.maValue = *pValues;
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
const ::std::list< sal_uInt32 >& rIndexes( (*pPropIter)->GetIndexes() );
for ( std::list<sal_uInt32>::const_iterator aIndexItr = rIndexes.begin();
aIndexItr != rIndexes.end();
++aIndexItr
)
{
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
++pPropIter;
++pValues;
}
}
}
else
{
aValues = xMultiPropSet->getPropertyValues( rApiNames );
2001-04-18 07:53:19 +00:00
const Any *pValues = aValues.getConstArray();
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
2010-12-19 16:36:43 +00:00
for(sal_uInt32 i = 0; i < nCount; ++i)
2001-04-18 07:53:19 +00:00
{
// The value is stored in the PropertySet itself, add to list.
XMLPropertyState aNewProperty( -1 );
2001-04-18 07:53:19 +00:00
aNewProperty.maValue = *pValues;
++pValues;
2001-04-18 07:53:19 +00:00
for( std::list<sal_uInt32>::iterator aIndexItr =
aItr->GetIndexes().begin();
aIndexItr != aItr->GetIndexes().end();
2010-12-19 16:36:43 +00:00
++aIndexItr )
2001-04-18 07:53:19 +00:00
{
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
2010-12-19 16:36:43 +00:00
++aItr;
2001-04-18 07:53:19 +00:00
}
}
}
else
{
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
2010-12-19 16:36:43 +00:00
for(sal_uInt32 i = 0; i < nCount; ++i)
{
bool bDirectValue =
!pStates || *pStates == PropertyState_DIRECT_VALUE;
if( bDirectValue || bDefault )
{
// The value is stored in the PropertySet itself, add to list.
bool bGotValue = false;
XMLPropertyState aNewProperty( -1 );
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
for( std::list<sal_uInt32>::const_iterator aIndexItr =
aItr->GetIndexes().begin();
aIndexItr != aItr->GetIndexes().end();
2010-12-19 16:36:43 +00:00
++aIndexItr )
{
if( bDirectValue ||
(rPropMapper->GetEntryFlags( *aIndexItr ) &
MID_FLAG_DEFAULT_ITEM_EXPORT) != 0 )
{
try
{
if( !bGotValue )
{
aNewProperty.maValue =
rPropSet->getPropertyValue( aItr->GetApiName() );
bGotValue = true;
}
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
catch( UnknownPropertyException& )
{
// might be a problem of getImplemenetationId
OSL_ENSURE( false, "unknown property in getPropertyValue" );
}
}
}
}
2001-04-18 07:53:19 +00:00
2010-12-19 16:36:43 +00:00
++aItr;
if( pStates )
2010-12-19 16:36:43 +00:00
++pStates;
}
}
}
aPropStates.FillPropertyStateVector(rPropStates);
}
}
struct SvXMLExportPropertyMapper::Impl
{
typedef std::map<css::uno::Reference<css::beans::XPropertySetInfo>, FilterPropertiesInfo_Impl*> CacheType;
CacheType maCache;
rtl::Reference<SvXMLExportPropertyMapper> mxNextMapper;
rtl::Reference<XMLPropertySetMapper> mxPropMapper;
OUString maStyleName;
~Impl()
{
CacheType::iterator it = maCache.begin(), itEnd = maCache.end();
for (; it != itEnd; ++it)
delete it->second;
}
};
// ctor/dtor , class SvXMLExportPropertyMapper
SvXMLExportPropertyMapper::SvXMLExportPropertyMapper(
const rtl::Reference< XMLPropertySetMapper >& rMapper ) :
mpImpl(new Impl)
{
mpImpl->mxPropMapper = rMapper;
}
SvXMLExportPropertyMapper::~SvXMLExportPropertyMapper()
{
delete mpImpl;
}
void SvXMLExportPropertyMapper::ChainExportMapper(
const rtl::Reference< SvXMLExportPropertyMapper>& rMapper )
{
// add map entries from rMapper to current map
mpImpl->mxPropMapper->AddMapperEntry( rMapper->getPropertySetMapper() );
// rMapper uses the same map as 'this'
rMapper->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
// set rMapper as last mapper in current chain
rtl::Reference< SvXMLExportPropertyMapper > xNext = mpImpl->mxNextMapper;
if( xNext.is())
{
while (xNext->mpImpl->mxNextMapper.is())
xNext = xNext->mpImpl->mxNextMapper;
xNext->mpImpl->mxNextMapper = rMapper;
}
else
mpImpl->mxNextMapper = rMapper;
// if rMapper was already chained, correct
// map pointer of successors
xNext = rMapper;
while (xNext->mpImpl->mxNextMapper.is())
{
xNext = xNext->mpImpl->mxNextMapper;
xNext->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
}
}
std::vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter(
const uno::Reference<beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily ) const
{
return _Filter(rPropSet, false, bEnableFoFontFamily);
}
std::vector<XMLPropertyState> SvXMLExportPropertyMapper::FilterDefaults(
const uno::Reference<beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily ) const
{
return _Filter(rPropSet, true, bEnableFoFontFamily);
}
vector<XMLPropertyState> SvXMLExportPropertyMapper::_Filter(
const Reference<XPropertySet>& xPropSet, bool bDefault, bool bEnableFoFontFamily ) const
{
vector< XMLPropertyState > aPropStateArray;
// Retrieve XPropertySetInfo and XPropertyState
Reference< XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
2001-04-18 07:53:19 +00:00
if( !xInfo.is() )
return aPropStateArray;
sal_Int32 nProps = mpImpl->mxPropMapper->GetEntryCount();
2001-04-18 07:53:19 +00:00
FilterPropertiesInfo_Impl *pFilterInfo = 0;
Impl::CacheType::iterator aIter = mpImpl->maCache.find(xInfo);
if (aIter != mpImpl->maCache.end())
pFilterInfo = (*aIter).second;
bool bDelInfo = false;
2001-04-19 12:52:21 +00:00
if( !pFilterInfo )
2001-04-18 07:53:19 +00:00
{
const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() );
2001-04-19 12:52:21 +00:00
pFilterInfo = new FilterPropertiesInfo_Impl;
2001-04-18 07:53:19 +00:00
for( sal_Int32 i=0; i < nProps; i++ )
{
// Are we allowed to ask for the property? (MID_FLAG_NO_PROP..)
// Does the PropertySet contain name of mpEntries-array ?
const OUString& rAPIName = mpImpl->mxPropMapper->GetEntryAPIName( i );
const sal_Int32 nFlags = mpImpl->mxPropMapper->GetEntryFlags( i );
2001-04-18 07:53:19 +00:00
if( (0 == (nFlags & MID_FLAG_NO_PROPERTY_EXPORT)) &&
( (0 != (nFlags & MID_FLAG_MUST_EXIST)) ||
xInfo->hasPropertyByName( rAPIName ) ) )
{
const SvtSaveOptions::ODFDefaultVersion nEarliestODFVersionForExport(
mpImpl->mxPropMapper->GetEarliestODFVersionForExport(i));
if( nCurrentVersion >= nEarliestODFVersionForExport
|| nCurrentVersion == SvtSaveOptions::ODFVER_UNKNOWN
|| nEarliestODFVersionForExport == SvtSaveOptions::ODFVER_UNKNOWN )
pFilterInfo->AddProperty(rAPIName, i);
}
2001-04-18 07:53:19 +00:00
}
2001-04-19 12:52:21 +00:00
// Check whether the property set info is destroyed if it is assigned to
// a weak reference only; If it is destroyed, then every instance of
// getPropertySetInfo returns a new object; such property set infos must
// not be cached:
WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
xInfo = 0;
xInfo = xWeakInfo;
if( xInfo.is() )
2001-04-19 12:52:21 +00:00
{
mpImpl->maCache.insert(Impl::CacheType::value_type(xInfo, pFilterInfo));
}
else
bDelInfo = true;
2001-04-18 07:53:19 +00:00
}
2001-04-18 07:53:19 +00:00
if( pFilterInfo->GetPropertyCount() )
{
try
{
pFilterInfo->FillPropertyStateArray(
aPropStateArray, xPropSet, mpImpl->mxPropMapper, bDefault);
}
2001-04-18 07:53:19 +00:00
catch( UnknownPropertyException& )
{
2001-04-18 07:53:19 +00:00
// might be a problem of getImplemenetationId
OSL_ENSURE( false, "unknown property in getPropertyStates" );
}
2001-04-18 07:53:19 +00:00
}
2001-04-18 07:53:19 +00:00
// Call centext-filter
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
if( !aPropStateArray.empty() )
ContextFilter(bEnableFoFontFamily, aPropStateArray, xPropSet);
2001-04-18 07:53:19 +00:00
// Have to do if we change from a vector to a list or something like that
2001-04-19 12:52:21 +00:00
if( bDelInfo )
delete pFilterInfo;
return aPropStateArray;
}
void SvXMLExportPropertyMapper::ContextFilter(
bool bEnableFoFontFamily,
vector< XMLPropertyState >& rProperties,
Reference< XPropertySet > rPropSet ) const
{
// Derived class could implement this.
if (mpImpl->mxNextMapper.is())
mpImpl->mxNextMapper->ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
// Compares two Sequences of XMLPropertyState:
// 1.Number of elements equal ?
// 2.Index of each element equal ? (So I know whether the propertynames are the same)
// 3.Value of each element equal ?
bool SvXMLExportPropertyMapper::Equals(
const vector< XMLPropertyState >& aProperties1,
const vector< XMLPropertyState >& aProperties2 ) const
{
bool bRet = true;
sal_uInt32 nCount = aProperties1.size();
if( nCount == aProperties2.size() )
{
sal_uInt32 nIndex = 0;
while( bRet && nIndex < nCount )
{
const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
// Compare index. If equal, compare value
if( rProp1.mnIndex == rProp2.mnIndex )
{
if( rProp1.mnIndex != -1 )
{
// Now compare values
if ( (mpImpl->mxPropMapper->GetEntryType( rProp1.mnIndex ) &
XML_TYPE_BUILDIN_CMP ) != 0 )
// simple type ( binary compare )
bRet = ( rProp1.maValue == rProp2.maValue );
else
// complex type ( ask for compare-function )
bRet = mpImpl->mxPropMapper->GetPropertyHandler(
rProp1.mnIndex )->equals( rProp1.maValue,
rProp2.maValue );
}
}
else
bRet = false;
nIndex++;
}
}
else
bRet = false;
return bRet;
}
/** fills the given attribute list with the items in the given set
2000-09-18 16:07:07 +00:00
void SvXMLExportPropertyMapper::exportXML( SvXMLAttributeList& rAttrList,
2000-10-19 13:25:20 +00:00
const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags ) const
2000-09-18 16:07:07 +00:00
{
2000-10-19 13:25:20 +00:00
_exportXML( rAttrList, rProperties, rUnitConverter, rNamespaceMap,
nFlags, 0, -1, -1 );
}
void SvXMLExportPropertyMapper::exportXML( SvXMLAttributeList& rAttrList,
const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
sal_uInt16 nFlags ) const
{
_exportXML( rAttrList, rProperties, rUnitConverter, rNamespaceMap,
nFlags, 0, nPropMapStartIdx, nPropMapEndIdx );
2000-09-18 16:07:07 +00:00
}
*/
2000-09-18 16:07:07 +00:00
2000-10-19 13:25:20 +00:00
void SvXMLExportPropertyMapper::exportXML(
SvXMLExport& rExport,
2000-10-19 13:25:20 +00:00
const ::std::vector< XMLPropertyState >& rProperties,
sal_uInt16 nFlags ) const
{
exportXML( rExport, rProperties, -1, -1, nFlags );
}
void SvXMLExportPropertyMapper::exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
sal_uInt16 nFlags, bool bExtensionNamespace ) const
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nPropTypeFlags = 0;
for( sal_uInt16 i=0; i<MAX_PROP_TYPES; ++i )
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nPropType = aPropTokens[i].nType;
if( 0==i || (nPropTypeFlags & (1 << nPropType)) != 0 )
{
2011-10-29 13:24:48 +02:00
std::vector<sal_uInt16> aIndexArray;
_exportXML( nPropType, nPropTypeFlags,
rExport.GetAttrList(), rProperties,
rExport.GetMM100UnitConverter(),
rExport.GetNamespaceMap(),
nFlags, &aIndexArray,
nPropMapStartIdx, nPropMapEndIdx );
if( rExport.GetAttrList().getLength() > 0L ||
(nFlags & XML_EXPORT_FLAG_EMPTY) != 0 ||
2011-10-29 13:24:48 +02:00
!aIndexArray.empty() )
{
sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
if(bExtensionNamespace && aPropTokens[i].eToken ==
xmloff::token::XML_GRAPHIC_PROPERTIES)
nNamespace = XML_NAMESPACE_LO_EXT;
SvXMLElementExport aElem( rExport, nNamespace,
aPropTokens[i].eToken,
(nFlags & XML_EXPORT_FLAG_IGN_WS) != 0,
false );
2000-09-18 16:07:07 +00:00
exportElementItems( rExport, rProperties, nFlags, aIndexArray );
}
}
2000-09-18 16:07:07 +00:00
}
}
2000-10-19 13:25:20 +00:00
/** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
void SvXMLExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList,
const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
const ::std::vector< XMLPropertyState > *pProperties,
sal_uInt32 nIdx ) const
2000-09-18 16:07:07 +00:00
{
OSL_ENSURE(mpImpl->mxNextMapper.is(), "special item not handled in xml export");
if (mpImpl->mxNextMapper.is())
mpImpl->mxNextMapper->handleSpecialItem(
rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx);
2000-09-18 16:07:07 +00:00
}
2000-10-19 13:25:20 +00:00
/** this method is called for every item that has the
MID_FLAG_ELEMENT_EXPORT flag set */
void SvXMLExportPropertyMapper::handleElementItem(
SvXMLExport& rExport,
2000-10-19 13:25:20 +00:00
const XMLPropertyState& rProperty,
sal_uInt16 nFlags,
const ::std::vector< XMLPropertyState > *pProperties,
sal_uInt32 nIdx ) const
2000-09-18 16:07:07 +00:00
{
OSL_ENSURE(mpImpl->mxNextMapper.is(), "element item not handled in xml export");
if (mpImpl->mxNextMapper.is())
mpImpl->mxNextMapper->handleElementItem(rExport, rProperty, nFlags, pProperties, nIdx);
2000-09-18 16:07:07 +00:00
}
// protected methods
/** fills the given attribute list with the items in the given set */
2000-10-19 13:25:20 +00:00
void SvXMLExportPropertyMapper::_exportXML(
sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
2000-10-19 13:25:20 +00:00
SvXMLAttributeList& rAttrList,
const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags,
2011-10-29 13:24:48 +02:00
std::vector<sal_uInt16>* pIndexArray,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const
2000-09-18 16:07:07 +00:00
{
2000-10-19 13:25:20 +00:00
const sal_uInt32 nCount = rProperties.size();
sal_uInt32 nIndex = 0;
2000-09-18 16:07:07 +00:00
if( -1 == nPropMapStartIdx )
nPropMapStartIdx = 0;
if( -1 == nPropMapEndIdx )
nPropMapEndIdx = mpImpl->mxPropMapper->GetEntryCount();
2000-09-18 16:07:07 +00:00
while( nIndex < nCount )
{
sal_Int32 nPropMapIdx = rProperties[nIndex].mnIndex;
if( nPropMapIdx >= nPropMapStartIdx &&
nPropMapIdx < nPropMapEndIdx )// valid entry?
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nEFlags = mpImpl->mxPropMapper->GetEntryFlags(nPropMapIdx);
sal_uInt16 nEPType = GET_PROP_TYPE(nEFlags);
OSL_ENSURE(nEPType >= (XML_TYPE_PROP_START >> XML_TYPE_PROP_SHIFT),
"no prop type specified");
rPropTypeFlags |= (1 << nEPType);
if( nEPType == nPropType )
2000-09-18 16:07:07 +00:00
{
// we have a valid map entry here, so lets use it...
if( ( nEFlags & MID_FLAG_ELEMENT_ITEM_EXPORT ) != 0 )
{
// element items do not add any properties,
// we export it later
if( pIndexArray )
2011-10-29 13:24:48 +02:00
{
pIndexArray->push_back( (sal_uInt16)nIndex );
}
}
else
{
_exportXML( rAttrList, rProperties[nIndex], rUnitConverter,
rNamespaceMap, nFlags, &rProperties, nIndex );
}
2000-09-18 16:07:07 +00:00
}
}
nIndex++;
}
}
2000-10-19 13:25:20 +00:00
void SvXMLExportPropertyMapper::_exportXML(
SvXMLAttributeList& rAttrList,
const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 /*nFlags*/,
2000-10-19 13:25:20 +00:00
const ::std::vector< XMLPropertyState > *pProperties,
sal_uInt32 nIdx ) const
2000-09-18 16:07:07 +00:00
{
if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_SPECIAL_ITEM_EXPORT) != 0)
2000-09-18 16:07:07 +00:00
{
2000-10-20 13:53:32 +00:00
uno::Reference< container::XNameContainer > xAttrContainer;
if( (rProperty.maValue >>= xAttrContainer) && xAttrContainer.is() )
2000-09-18 16:07:07 +00:00
{
SvXMLNamespaceMap *pNewNamespaceMap = 0;
const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
2000-10-20 13:53:32 +00:00
uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
const OUString* pAttribName = aAttribNames.getConstArray();
const sal_Int32 nCount = aAttribNames.getLength();
2000-09-18 16:07:07 +00:00
OUStringBuffer sNameBuffer;
2000-10-20 13:53:32 +00:00
xml::AttributeData aData;
for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
2000-09-18 16:07:07 +00:00
{
2000-10-20 13:53:32 +00:00
xAttrContainer->getByName( *pAttribName ) >>= aData;
OUString sAttribName( *pAttribName );
2000-10-20 13:53:32 +00:00
// extract namespace prefix from attribute name if it exists
OUString sPrefix;
const sal_Int32 nColonPos =
pAttribName->indexOf( ':' );
if( nColonPos != -1 )
sPrefix = pAttribName->copy( 0, nColonPos );
2000-10-20 13:53:32 +00:00
if( !sPrefix.isEmpty() )
2000-09-18 16:07:07 +00:00
{
2000-10-20 13:53:32 +00:00
OUString sNamespace( aData.Namespace );
2000-09-18 16:07:07 +00:00
// if the prefix isn't defined yet or has another meaning,
// we have to redefine it now.
2001-07-10 16:12:09 +00:00
sal_uInt16 nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
if( USHRT_MAX == nKey || pNamespaceMap->GetNameByKey( nKey ) != sNamespace )
2000-09-18 16:07:07 +00:00
{
bool bAddNamespace = false;
if( USHRT_MAX == nKey )
2000-09-18 16:07:07 +00:00
{
// The prefix is unused, so it is sufficient
// to add it to the namespace map.
bAddNamespace = true;
2000-09-18 16:07:07 +00:00
}
else
{
// check if there is a prefix registered for the
// namepsace URI
nKey = pNamespaceMap->GetKeyByName( sNamespace );
if( XML_NAMESPACE_UNKNOWN == nKey )
{
// There is no prefix for the namespace, so
// we have to generate one and have to add it.
sal_Int32 n=0;
OUString sOrigPrefix( sPrefix );
do
{
sNameBuffer.append( sOrigPrefix );
sNameBuffer.append( ++n );
sPrefix = sNameBuffer.makeStringAndClear();
nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
}
while( nKey != USHRT_MAX );
2000-09-18 16:07:07 +00:00
bAddNamespace = true;
}
else
{
// If there is a prefix for the namespace,
// we reuse that.
sPrefix = pNamespaceMap->GetPrefixByKey( nKey );
}
// In any case, the attribute name has to be adapted.
sNameBuffer.append( sPrefix + ":" + pAttribName->copy( nColonPos+1 ) );
sAttribName = sNameBuffer.makeStringAndClear();
}
if( bAddNamespace )
{
if( !pNewNamespaceMap )
{
pNewNamespaceMap = new SvXMLNamespaceMap( rNamespaceMap );
pNamespaceMap = pNewNamespaceMap;
}
pNewNamespaceMap->Add( sPrefix, sNamespace );
sNameBuffer.append( GetXMLToken(XML_XMLNS) + ":" + sPrefix );
rAttrList.AddAttribute( sNameBuffer.makeStringAndClear(),
sNamespace );
}
2000-09-18 16:07:07 +00:00
}
}
OUString sOldValue( rAttrList.getValueByName( sAttribName ) );
OSL_ENSURE( sOldValue.isEmpty(), "alien attribute exists already" );
OSL_ENSURE(aData.Type == GetXMLToken(XML_CDATA), "different type to our default type which should be written out");
if( sOldValue.isEmpty() )
rAttrList.AddAttribute( sAttribName, aData.Value );
2000-09-18 16:07:07 +00:00
}
delete pNewNamespaceMap;
}
else
{
2000-10-19 13:25:20 +00:00
handleSpecialItem( rAttrList, rProperty, rUnitConverter,
rNamespaceMap, pProperties, nIdx );
2000-09-18 16:07:07 +00:00
}
}
else if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_ELEMENT_ITEM_EXPORT ) == 0)
2000-09-18 16:07:07 +00:00
{
OUString aValue;
const OUString sName = rNamespaceMap.GetQNameByKey(
mpImpl->mxPropMapper->GetEntryNameSpace(rProperty.mnIndex),
mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
2000-09-18 16:07:07 +00:00
bool bRemove = false;
if ((mpImpl->mxPropMapper->GetEntryFlags( rProperty.mnIndex ) & MID_FLAG_MERGE_ATTRIBUTE) != 0)
2000-09-18 16:07:07 +00:00
{
aValue = rAttrList.getValueByName( sName );
bRemove = true;
2000-09-18 16:07:07 +00:00
}
if (mpImpl->mxPropMapper->exportXML(aValue, rProperty, rUnitConverter))
2000-09-18 16:07:07 +00:00
{
if( bRemove )
rAttrList.RemoveAttribute( sName );
rAttrList.AddAttribute( sName, aValue );
2000-09-18 16:07:07 +00:00
}
}
}
2000-10-19 13:25:20 +00:00
void SvXMLExportPropertyMapper::exportElementItems(
SvXMLExport& rExport,
2000-10-19 13:25:20 +00:00
const ::std::vector< XMLPropertyState >& rProperties,
sal_uInt16 nFlags,
2011-10-29 13:24:48 +02:00
const std::vector<sal_uInt16>& rIndexArray ) const
2000-09-18 16:07:07 +00:00
{
2011-10-29 13:24:48 +02:00
const sal_uInt16 nCount = rIndexArray.size();
2000-09-18 16:07:07 +00:00
bool bItemsExported = false;
2000-09-18 16:07:07 +00:00
for( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
2011-10-29 13:24:48 +02:00
const sal_uInt16 nElement = rIndexArray[nIndex];
2000-09-18 16:07:07 +00:00
OSL_ENSURE( 0 != (mpImpl->mxPropMapper->GetEntryFlags(
2000-10-19 13:25:20 +00:00
rProperties[nElement].mnIndex ) & MID_FLAG_ELEMENT_ITEM_EXPORT),
"wrong mid flag!" );
2000-09-18 16:07:07 +00:00
rExport.IgnorableWhitespace();
handleElementItem( rExport, rProperties[nElement],
nFlags, &rProperties, nElement );
bItemsExported = true;
2000-09-18 16:07:07 +00:00
}
if( bItemsExported )
rExport.IgnorableWhitespace();
2000-09-18 16:07:07 +00:00
}
const rtl::Reference<XMLPropertySetMapper>& SvXMLExportPropertyMapper::getPropertySetMapper() const
{
return mpImpl->mxPropMapper;
}
void SvXMLExportPropertyMapper::SetStyleName( const OUString& rStyleName )
{
mpImpl->maStyleName = rStyleName;
}
const OUString& SvXMLExportPropertyMapper::GetStyleName() const
{
return mpImpl->maStyleName;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */