2010-10-12 15:56:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-16 17:32:30 +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 .
|
|
|
|
*/
|
2008-01-17 07:06:10 +00:00
|
|
|
|
|
|
|
#include "oox/drawingml/shape.hxx"
|
2010-03-23 14:27:33 +02:00
|
|
|
#include "oox/drawingml/customshapeproperties.hxx"
|
2008-07-01 11:00:20 +00:00
|
|
|
#include "oox/drawingml/theme.hxx"
|
2008-07-22 12:40:31 +00:00
|
|
|
#include "oox/drawingml/fillproperties.hxx"
|
|
|
|
#include "oox/drawingml/lineproperties.hxx"
|
2012-09-26 12:22:17 +01:00
|
|
|
#include "oox/drawingml/effectproperties.hxx"
|
2011-01-11 13:26:59 +01:00
|
|
|
#include "oox/drawingml/shapepropertymap.hxx"
|
2008-07-01 11:00:20 +00:00
|
|
|
#include "oox/drawingml/textbody.hxx"
|
2008-07-22 12:40:31 +00:00
|
|
|
#include "oox/drawingml/table/tableproperties.hxx"
|
2010-08-26 18:37:44 +02:00
|
|
|
#include "oox/drawingml/chart/chartconverter.hxx"
|
|
|
|
#include "oox/drawingml/chart/chartspacefragment.hxx"
|
|
|
|
#include "oox/drawingml/chart/chartspacemodel.hxx"
|
|
|
|
#include "oox/vml/vmldrawing.hxx"
|
|
|
|
#include "oox/vml/vmlshape.hxx"
|
|
|
|
#include "oox/vml/vmlshapecontainer.hxx"
|
2008-07-22 12:40:31 +00:00
|
|
|
#include "oox/core/xmlfilterbase.hxx"
|
2010-08-26 18:37:44 +02:00
|
|
|
#include "oox/helper/graphichelper.hxx"
|
2008-04-18 13:14:41 +00:00
|
|
|
#include "oox/helper/propertyset.hxx"
|
2014-03-06 21:21:43 +05:30
|
|
|
#include "oox/helper/modelobjecthelper.hxx"
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <tools/gen.hxx>
|
|
|
|
#include <tools/mapunit.hxx>
|
2013-09-03 11:13:22 +03:00
|
|
|
#include <editeng/unoprnms.hxx>
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <com/sun/star/awt/Size.hpp>
|
2008-01-17 07:06:10 +00:00
|
|
|
#include <com/sun/star/graphic/XGraphic.hpp>
|
|
|
|
#include <com/sun/star/container/XNamed.hpp>
|
2011-08-12 15:53:12 +02:00
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
2008-01-17 07:06:10 +00:00
|
|
|
#include <com/sun/star/beans/XMultiPropertySet.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
2011-08-12 15:53:12 +02:00
|
|
|
#include <com/sun/star/xml/AttributeData.hpp>
|
2008-01-17 07:06:10 +00:00
|
|
|
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
|
2010-10-08 22:28:39 +02:00
|
|
|
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
|
2008-01-17 07:06:10 +00:00
|
|
|
#include <com/sun/star/text/XText.hpp>
|
2013-12-19 12:26:53 +01:00
|
|
|
#include <com/sun/star/table/BorderLine2.hpp>
|
2013-12-20 10:23:56 +01:00
|
|
|
#include <com/sun/star/table/ShadowFormat.hpp>
|
2010-08-26 18:37:44 +02:00
|
|
|
#include <com/sun/star/chart2/XChartDocument.hpp>
|
2010-10-08 22:28:39 +02:00
|
|
|
#include <com/sun/star/style/ParagraphAdjust.hpp>
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <com/sun/star/io/XOutputStream.hpp>
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
#include <basegfx/point/b2dpoint.hxx>
|
|
|
|
#include <basegfx/polygon/b2dpolygon.hxx>
|
|
|
|
#include <basegfx/matrix/b2dhommatrix.hxx>
|
2010-03-12 21:43:17 +01:00
|
|
|
#include <com/sun/star/document/XActionLockable.hpp>
|
2013-07-09 13:31:16 +05:30
|
|
|
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <svl/outstrm.hxx>
|
2014-04-14 17:27:35 +02:00
|
|
|
#include <svx/svdtrans.hxx>
|
2013-09-26 20:35:48 +03:00
|
|
|
#include <unotools/streamwrap.hxx>
|
|
|
|
#include <unotools/fltrcfg.hxx>
|
|
|
|
#include <vcl/graph.hxx>
|
|
|
|
#include <vcl/graphicfilter.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2014-04-24 18:39:27 +02:00
|
|
|
#include <vcl/wmf.hxx>
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
using namespace ::oox::core;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::frame;
|
|
|
|
using namespace ::com::sun::star::text;
|
|
|
|
using namespace ::com::sun::star::drawing;
|
2010-10-08 22:28:39 +02:00
|
|
|
using namespace ::com::sun::star::style;
|
2008-01-17 07:06:10 +00:00
|
|
|
|
|
|
|
namespace oox { namespace drawingml {
|
|
|
|
|
2014-01-27 19:46:37 +01:00
|
|
|
#define PUT_PROP( aProperties, nPos, sPropName, aPropValue ) \
|
|
|
|
aProperties[nPos].Name = sPropName; \
|
|
|
|
aProperties[nPos].Value = Any( aPropValue );
|
|
|
|
|
2014-01-03 12:07:30 +01:00
|
|
|
Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
|
2010-10-08 14:49:01 +02:00
|
|
|
: mbIsChild( false )
|
|
|
|
, mpLinePropertiesPtr( new LineProperties )
|
2008-07-22 12:40:31 +00:00
|
|
|
, mpFillPropertiesPtr( new FillProperties )
|
CWS-TOOLING: integrate CWS dr68
2009-06-19 17:43:48 +0200 oc r273175 : #i102946# some lines for new dialog added
2009-06-19 14:17:45 +0200 oc r273158 : #i102946# three lines added
2009-05-19 11:56:14 +0200 dr r272065 : #i99677# wrong attribute name
2009-05-18 18:37:05 +0200 dr r272045 : #i10000# suncc warning
2009-05-05 16:46:13 +0200 dr r271536 : #i10000# adoptions after rebase to master containing dr67
2009-05-05 16:01:19 +0200 dr r271530 : #i10000# adoptions after rebase to master containing dr67
2009-05-04 14:20:39 +0200 dr r271453 : CWS-TOOLING: rebase CWS dr68 to trunk@271427 (milestone: DEV300:m47)
2009-04-28 17:01:14 +0200 dr r271332 : CWS-TOOLING: rebase CWS dr68 to trunk@270723 (milestone: DEV300:m46)
2009-04-23 12:21:40 +0200 dr r271149 : #i100688# missing checkins
2009-04-23 12:18:16 +0200 dr r271147 : #i100978# relations path handling
2009-04-22 19:25:45 +0200 nn r271136 : #i49491# show navigator for double click on document position status bar control
2009-04-22 11:28:36 +0200 nn r271085 : #i60401# small text change
2009-04-21 16:53:23 +0200 dr r271044 : #i10000# missing dtor
2009-04-20 13:39:25 +0200 nn r270977 : #i60401# add dialog to extend sort range (patch from maoyg)
2009-04-08 12:11:08 +0200 dr r270630 : #i100943# prevent assertion when loading chart with empty category ranges
2009-04-07 19:03:00 +0200 dr r270609 : #i100688# missing bits for OLE
2009-04-07 17:14:06 +0200 dr r270605 : ported fix for #i100710#
2009-04-07 17:12:50 +0200 dr r270604 : #i10000# wae
2009-04-07 15:31:55 +0200 dr r270598 : import system colors moved to FilterBase class, more rework on fill and color contexts
2009-04-06 15:00:03 +0200 dr r270552 : #i99677# prevent recursive loading of the current document
2009-04-03 18:28:42 +0200 dr r270515 : added import of brightness/contrast and mono/grayscale color effects for image shapes
2009-04-03 17:36:03 +0200 dr r270509 : cache already imported embedded graphics
2009-04-03 16:46:34 +0200 dr r270500 : more rework on bitmap fill and graphic object handling
2009-03-31 12:28:10 +0200 dr r270271 : #i10000# unxlngi6 wae
2009-03-31 09:04:10 +0200 dr r270261 : CWS-TOOLING: rebase CWS dr68 to trunk@270033 (milestone: DEV300:m45)
2009-03-30 17:42:05 +0200 dr r270249 : #i91122# add missing doc
2009-03-30 17:37:08 +0200 dr r270248 : #i91122# add missing doc
2009-03-30 16:59:15 +0200 dr r270241 : #i99677# add import of ActiveX scrollbar controls
2009-03-30 14:30:36 +0200 dr r270230 : #i91122# missing/wrong documentation
2009-03-30 13:03:38 +0200 dr r270220 : #i99677# add import of ActiveX combobox and spinbutton controls
2009-03-27 11:46:59 +0100 dr r270144 : #i99677# import ActiveX listbox controls (Forms.ListBox.1)
2009-03-26 19:58:00 +0100 dr r270104 : #i99677# move more OLE import code into ole submodule
2009-03-26 15:15:02 +0100 dr r270082 : #i100546# add import of chart bitmap fills, add import of X/Y offset in tiled bitmap fills of all shapes
2009-03-25 12:54:59 +0100 dr r270018 : #i99677# import ActiveX edit text control (Forms.TextBox.1)
2009-03-24 10:59:29 +0100 dr r269921 : #i99677# moved import of OLE StdHlink to 'ole' submodule, added string import helpers to BinaryStreamBase class, removed implementation of ST_XString import from docprop in favour of the implementation in class AttributeList
2009-03-24 10:40:18 +0100 dr r269919 : #i100502# implicit precedence of '&&' was intended
2009-03-24 10:18:29 +0100 dr r269917 : #i100502# missing parentheses
2009-03-23 15:17:48 +0100 dr r269876 : #i99677# more code reorg, added graphic helper and OLE helper object per filter, added OLE/control import to PPTX/XLSX filter, moved helpers from XmlFilterBase to FilterBase
2009-03-19 12:45:20 +0100 dr r269740 : #i99677# interface changes in oox
2009-03-18 15:51:50 +0100 dr r269683 : #i99677# improved relation handling (internal/external), added preprocessor for VML streams to eat MS specific instructions, added OCX ToggleButton/OptionButton import, added DIB import for BIFF (page background picture, lots of other minor improvements
2009-03-16 15:25:30 +0100 dr r269551 : #i99677# import excel form control client data (printable, cell link)
2009-03-13 18:37:17 +0100 dr r269494 : #i99677# import image controls and check boxes
2009-03-12 15:08:18 +0100 dr r269420 : #i10000# rebase problems
2009-03-12 14:43:09 +0100 dr r269418 : #i10000# rebase problems
2009-03-12 14:42:41 +0100 dr r269417 : #i10000# missing delivered header
2009-03-12 13:57:06 +0100 dr r269405 : #i10000# typos
2009-03-12 12:58:52 +0100 dr r269391 : CWS-TOOLING: rebase CWS dr68 to trunk@269297 (milestone: DEV300:m43)
2009-03-12 11:11:46 +0100 dr r269374 : #i99677# first step to import BIFF8 page background
2009-03-12 10:21:53 +0100 dr r269364 : #i99677# rework of graphic import in entire filter, added import of AX Label controls
2009-03-09 16:44:50 +0100 dr r269202 : #i99677# import some formatting attributes of command buttons
2009-03-05 15:31:46 +0100 dr r268911 : #i99677# use VML shape client data to import excel VML shape positions
2009-03-05 11:39:48 +0100 dr r268888 : #i99677# create UNO control shapes from VML control shapes
2009-03-05 11:38:59 +0100 dr r268886 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-05 11:30:40 +0100 dr r268885 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-04 18:46:05 +0100 dr r268860 : adapt namespace ids according to oox
2009-03-04 18:43:49 +0100 dr r268859 : #i99677# more VML import rework
2009-03-03 13:38:36 +0100 dr r268721 : #i99677# more cleanup for VML filter
2009-03-03 13:13:15 +0100 dr r268719 : #i99807# do not iterate beyond end of std::list
2009-03-02 11:55:49 +0100 dr r268644 : add ST_XString support (encoded characters in attribute values)
2009-02-26 17:07:18 +0100 dr r268542 : #i99677# first steps of ax control import: dummy AX base classes, reimplement VML import (hopefully without breaking anything), register embedded AX controls at VML drawing
2009-02-23 17:43:50 +0100 dr r268365 : #i99426# remaining work on scenario import
2009-02-19 16:56:25 +0100 dr r268295 : #i99426# base implementations for scenarios import
2009-07-15 14:57:49 +00:00
|
|
|
, mpGraphicPropertiesPtr( new GraphicProperties )
|
2008-07-22 12:40:31 +00:00
|
|
|
, mpCustomShapePropertiesPtr( new CustomShapeProperties )
|
2014-04-30 19:00:43 +02:00
|
|
|
, mp3DPropertiesPtr( new Shape3DProperties )
|
2012-09-26 12:22:17 +01:00
|
|
|
, mpEffectPropertiesPtr( new EffectProperties )
|
2008-07-22 12:40:31 +00:00
|
|
|
, mpMasterTextListStyle( new TextListStyle )
|
2008-01-17 07:06:10 +00:00
|
|
|
, mnSubType( 0 )
|
2010-08-26 18:37:44 +02:00
|
|
|
, meFrameType( FRAMETYPE_GENERIC )
|
2008-01-17 07:06:10 +00:00
|
|
|
, mnRotation( 0 )
|
|
|
|
, mbFlipH( false )
|
|
|
|
, mbFlipV( false )
|
2010-03-16 15:59:04 +01:00
|
|
|
, mbHidden( false )
|
2011-08-24 14:23:47 +02:00
|
|
|
, mbHiddenMasterShape( false )
|
2013-06-20 20:56:26 +02:00
|
|
|
, mbLockedCanvas( false )
|
2013-11-21 11:44:22 +01:00
|
|
|
, mbWps( false )
|
2014-05-06 17:00:40 +02:00
|
|
|
, mbTextBox( false )
|
2014-04-29 16:57:26 +01:00
|
|
|
, mbHasLinkedTxbx( false )
|
2013-09-03 11:13:22 +03:00
|
|
|
, maDiagramDoms( 0 )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
if ( pServiceName )
|
|
|
|
msServiceName = OUString::createFromAscii( pServiceName );
|
2014-01-03 12:07:30 +01:00
|
|
|
setDefaults(bDefaultHeight);
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
2010-08-26 18:37:44 +02:00
|
|
|
|
2011-08-12 15:53:12 +02:00
|
|
|
Shape::Shape( const ShapePtr& pSourceShape )
|
|
|
|
: maChildren()
|
|
|
|
, mbIsChild( pSourceShape->mbIsChild )
|
|
|
|
, mpTextBody(pSourceShape->mpTextBody)
|
|
|
|
, mpLinePropertiesPtr( pSourceShape->mpLinePropertiesPtr )
|
|
|
|
, mpFillPropertiesPtr( pSourceShape->mpFillPropertiesPtr )
|
|
|
|
, mpGraphicPropertiesPtr( pSourceShape->mpGraphicPropertiesPtr )
|
|
|
|
, mpCustomShapePropertiesPtr( pSourceShape->mpCustomShapePropertiesPtr )
|
|
|
|
, mpTablePropertiesPtr( pSourceShape->mpTablePropertiesPtr )
|
|
|
|
, mp3DPropertiesPtr( pSourceShape->mp3DPropertiesPtr )
|
2012-09-26 12:22:17 +01:00
|
|
|
, mpEffectPropertiesPtr (pSourceShape->mpEffectPropertiesPtr)
|
2011-08-12 15:53:12 +02:00
|
|
|
, maShapeProperties( pSourceShape->maShapeProperties )
|
|
|
|
, mpMasterTextListStyle( pSourceShape->mpMasterTextListStyle )
|
|
|
|
, mxShape()
|
|
|
|
, msServiceName( pSourceShape->msServiceName )
|
|
|
|
, msName( pSourceShape->msName )
|
|
|
|
, msId( pSourceShape->msId )
|
|
|
|
, mnSubType( pSourceShape->mnSubType )
|
2012-04-26 19:19:03 +05:30
|
|
|
, moSubTypeIndex( pSourceShape->moSubTypeIndex )
|
2011-08-12 15:53:12 +02:00
|
|
|
, maShapeStyleRefs( pSourceShape->maShapeStyleRefs )
|
|
|
|
, maSize( pSourceShape->maSize )
|
|
|
|
, maPosition( pSourceShape->maPosition )
|
|
|
|
, meFrameType( pSourceShape->meFrameType )
|
|
|
|
, mnRotation( pSourceShape->mnRotation )
|
|
|
|
, mbFlipH( pSourceShape->mbFlipH )
|
|
|
|
, mbFlipV( pSourceShape->mbFlipV )
|
|
|
|
, mbHidden( pSourceShape->mbHidden )
|
2011-08-24 14:23:47 +02:00
|
|
|
, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
|
2013-06-20 20:56:26 +02:00
|
|
|
, mbLockedCanvas( pSourceShape->mbLockedCanvas )
|
2013-11-21 11:44:22 +01:00
|
|
|
, mbWps( pSourceShape->mbWps )
|
2014-05-06 17:00:40 +02:00
|
|
|
, mbTextBox( pSourceShape->mbTextBox )
|
2014-04-18 13:12:53 +05:30
|
|
|
, maLinkedTxbxAttr()
|
|
|
|
, mbHasLinkedTxbx(false)
|
2013-09-03 11:13:22 +03:00
|
|
|
, maDiagramDoms( pSourceShape->maDiagramDoms )
|
2011-08-12 15:53:12 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
Shape::~Shape()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
table::TablePropertiesPtr Shape::getTableProperties()
|
|
|
|
{
|
|
|
|
if ( !mpTablePropertiesPtr.get() )
|
|
|
|
mpTablePropertiesPtr.reset( new table::TableProperties() );
|
|
|
|
return mpTablePropertiesPtr;
|
|
|
|
}
|
|
|
|
|
2014-01-03 12:07:30 +01:00
|
|
|
void Shape::setDefaults(bool bHeight)
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextAutoGrowHeight, false);
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextWordWrap, true);
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextLeftDistance, static_cast< sal_Int32 >( 250 ));
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextUpperDistance, static_cast< sal_Int32 >( 125 ));
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextRightDistance, static_cast< sal_Int32 >( 250 ));
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextLowerDistance, static_cast< sal_Int32 >( 125 ));
|
2014-01-03 12:07:30 +01:00
|
|
|
if (bHeight)
|
2014-03-04 09:34:37 +01:00
|
|
|
maDefaultShapeProperties.setProperty(PROP_CharHeight, static_cast< float >( 18.0 ));
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_TextVerticalAdjust, TextVerticalAdjust_TOP);
|
|
|
|
maDefaultShapeProperties.setProperty(PROP_ParaAdjust, static_cast< sal_Int16 >( ParagraphAdjust_LEFT )); // check for RTL?
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
2010-08-26 18:37:44 +02:00
|
|
|
::oox::vml::OleObjectInfo& Shape::setOleObjectType()
|
|
|
|
{
|
|
|
|
OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setOleObjectType - multiple frame types" );
|
|
|
|
meFrameType = FRAMETYPE_OLEOBJECT;
|
|
|
|
mxOleObjectInfo.reset( new ::oox::vml::OleObjectInfo( true ) );
|
|
|
|
return *mxOleObjectInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
ChartShapeInfo& Shape::setChartType( bool bEmbedShapes )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" );
|
|
|
|
meFrameType = FRAMETYPE_CHART;
|
2013-01-04 15:39:44 +01:00
|
|
|
msServiceName = "com.sun.star.drawing.OLE2Shape";
|
2010-08-26 18:37:44 +02:00
|
|
|
mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) );
|
|
|
|
return *mxChartShapeInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Shape::setDiagramType()
|
|
|
|
{
|
|
|
|
OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setDiagramType - multiple frame types" );
|
|
|
|
meFrameType = FRAMETYPE_DIAGRAM;
|
2013-01-04 15:39:44 +01:00
|
|
|
msServiceName = "com.sun.star.drawing.GroupShape";
|
2010-08-26 18:37:44 +02:00
|
|
|
mnSubType = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Shape::setTableType()
|
|
|
|
{
|
|
|
|
OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setTableType - multiple frame types" );
|
|
|
|
meFrameType = FRAMETYPE_TABLE;
|
2013-01-04 15:39:44 +01:00
|
|
|
msServiceName = "com.sun.star.drawing.TableShape";
|
2010-08-26 18:37:44 +02:00
|
|
|
mnSubType = 0;
|
|
|
|
}
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
void Shape::setServiceName( const sal_Char* pServiceName )
|
|
|
|
{
|
|
|
|
if ( pServiceName )
|
|
|
|
msServiceName = OUString::createFromAscii( pServiceName );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const
|
|
|
|
{
|
|
|
|
ShapeStyleRefMap::const_iterator aIt = maShapeStyleRefs.find( nRefType );
|
|
|
|
return (aIt == maShapeStyleRefs.end()) ? 0 : &aIt->second;
|
|
|
|
}
|
|
|
|
|
2008-03-05 17:25:23 +00:00
|
|
|
void Shape::addShape(
|
2010-08-26 18:37:44 +02:00
|
|
|
::oox::core::XmlFilterBase& rFilterBase,
|
2009-07-13 08:56:32 +00:00
|
|
|
const Theme* pTheme,
|
2008-03-05 17:25:23 +00:00
|
|
|
const Reference< XShapes >& rxShapes,
|
2011-04-27 18:59:10 +02:00
|
|
|
basegfx::B2DHomMatrix& aTransformation,
|
2013-03-12 20:37:15 +00:00
|
|
|
FillProperties& rShapeOrParentShapeFillProps,
|
2008-03-05 17:25:23 +00:00
|
|
|
const awt::Rectangle* pShapeRect,
|
|
|
|
ShapeIdMap* pShapeMap )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << " id: " << msId);
|
2011-08-24 14:23:47 +02:00
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
try
|
|
|
|
{
|
2012-12-06 23:46:58 -02:00
|
|
|
OUString sServiceName( msServiceName );
|
2012-01-01 12:55:53 -02:00
|
|
|
if( !sServiceName.isEmpty() )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2011-04-27 18:59:10 +02:00
|
|
|
basegfx::B2DHomMatrix aMatrix( aTransformation );
|
2014-04-01 13:41:19 +02:00
|
|
|
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, false, false, aMatrix, rShapeOrParentShapeFillProps ) );
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2012-01-01 12:55:53 -02:00
|
|
|
if( pShapeMap && !msId.isEmpty() )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2008-03-05 17:25:23 +00:00
|
|
|
(*pShapeMap)[ msId ] = shared_from_this();
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// if this is a group shape, we have to add also each child shape
|
|
|
|
Reference< XShapes > xShapes( xShape, UNO_QUERY );
|
|
|
|
if ( xShapes.is() )
|
2011-04-27 18:59:10 +02:00
|
|
|
addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap, aMatrix );
|
2013-09-26 20:35:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
if( meFrameType == FRAMETYPE_DIAGRAM )
|
|
|
|
{
|
|
|
|
if( !SvtFilterOptions::Get().IsSmartArt2Shape() )
|
|
|
|
keepDiagramCompatibilityInfo( rFilterBase );
|
|
|
|
}
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
}
|
2013-09-26 20:35:48 +03:00
|
|
|
catch( const Exception& e )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2013-09-26 20:35:48 +03:00
|
|
|
SAL_WARN( "oox.drawingml", OSL_THIS_FUNC << "Exception: " << e.Message );
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-20 20:56:26 +02:00
|
|
|
void Shape::setLockedCanvas(bool bLockedCanvas)
|
|
|
|
{
|
|
|
|
mbLockedCanvas = bLockedCanvas;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Shape::getLockedCanvas()
|
|
|
|
{
|
|
|
|
return mbLockedCanvas;
|
|
|
|
}
|
|
|
|
|
2013-11-21 11:44:22 +01:00
|
|
|
void Shape::setWps(bool bWps)
|
|
|
|
{
|
|
|
|
mbWps = bWps;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Shape::getWps()
|
|
|
|
{
|
|
|
|
return mbWps;
|
|
|
|
}
|
|
|
|
|
2014-05-06 17:00:40 +02:00
|
|
|
void Shape::setTextBox(bool bTextBox)
|
|
|
|
{
|
|
|
|
mbTextBox = bTextBox;
|
|
|
|
}
|
|
|
|
|
2012-05-08 13:03:38 +05:30
|
|
|
void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox", OSL_THIS_FUNC << "apply shape reference: " << rReferencedShape.msId << " to shape id: " << msId);
|
2011-08-17 10:39:00 +02:00
|
|
|
|
2012-05-08 13:03:38 +05:30
|
|
|
if ( rReferencedShape.mpTextBody.get() && bUseText )
|
2011-04-19 10:19:19 +02:00
|
|
|
mpTextBody = TextBodyPtr( new TextBody( *rReferencedShape.mpTextBody.get() ) );
|
|
|
|
else
|
|
|
|
mpTextBody.reset();
|
2008-01-17 07:06:10 +00:00
|
|
|
maShapeProperties = rReferencedShape.maShapeProperties;
|
|
|
|
mpLinePropertiesPtr = LinePropertiesPtr( new LineProperties( *rReferencedShape.mpLinePropertiesPtr.get() ) );
|
|
|
|
mpFillPropertiesPtr = FillPropertiesPtr( new FillProperties( *rReferencedShape.mpFillPropertiesPtr.get() ) );
|
|
|
|
mpCustomShapePropertiesPtr = CustomShapePropertiesPtr( new CustomShapeProperties( *rReferencedShape.mpCustomShapePropertiesPtr.get() ) );
|
2008-06-20 05:54:51 +00:00
|
|
|
mpTablePropertiesPtr = table::TablePropertiesPtr( rReferencedShape.mpTablePropertiesPtr.get() ? new table::TableProperties( *rReferencedShape.mpTablePropertiesPtr.get() ) : NULL );
|
2012-09-26 12:22:17 +01:00
|
|
|
mpEffectPropertiesPtr = EffectPropertiesPtr( new EffectProperties( *rReferencedShape.mpEffectPropertiesPtr.get() ) );
|
2008-01-17 07:06:10 +00:00
|
|
|
mpMasterTextListStyle = TextListStylePtr( new TextListStyle( *rReferencedShape.mpMasterTextListStyle.get() ) );
|
2008-07-22 12:40:31 +00:00
|
|
|
maShapeStyleRefs = rReferencedShape.maShapeStyleRefs;
|
2008-01-17 07:06:10 +00:00
|
|
|
maSize = rReferencedShape.maSize;
|
|
|
|
maPosition = rReferencedShape.maPosition;
|
|
|
|
mnRotation = rReferencedShape.mnRotation;
|
|
|
|
mbFlipH = rReferencedShape.mbFlipH;
|
|
|
|
mbFlipV = rReferencedShape.mbFlipV;
|
2010-03-16 15:59:04 +01:00
|
|
|
mbHidden = rReferencedShape.mbHidden;
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
2011-08-12 15:53:12 +02:00
|
|
|
void Shape::addChildren( ::oox::core::XmlFilterBase& rFilterBase,
|
|
|
|
const Theme* pTheme,
|
|
|
|
const Reference< XShapes >& rxShapes,
|
|
|
|
basegfx::B2DHomMatrix& aTransformation,
|
|
|
|
const awt::Rectangle* pShapeRect,
|
|
|
|
ShapeIdMap* pShapeMap )
|
|
|
|
{
|
|
|
|
addChildren(rFilterBase, *this, pTheme, rxShapes,
|
|
|
|
pShapeRect ?
|
|
|
|
*pShapeRect :
|
|
|
|
awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ),
|
|
|
|
pShapeMap, aTransformation);
|
|
|
|
}
|
|
|
|
|
2012-03-01 22:24:04 +01:00
|
|
|
struct ActionLockGuard
|
|
|
|
{
|
|
|
|
explicit ActionLockGuard(Reference<drawing::XShape> const& xShape)
|
|
|
|
: m_xLockable(xShape, UNO_QUERY)
|
|
|
|
{
|
|
|
|
if (m_xLockable.is()) {
|
|
|
|
m_xLockable->addActionLock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~ActionLockGuard()
|
|
|
|
{
|
|
|
|
if (m_xLockable.is()) {
|
|
|
|
m_xLockable->removeActionLock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
Reference<document::XActionLockable> m_xLockable;
|
|
|
|
};
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
// for group shapes, the following method is also adding each child
|
2008-07-22 12:40:31 +00:00
|
|
|
void Shape::addChildren(
|
2010-08-26 18:37:44 +02:00
|
|
|
XmlFilterBase& rFilterBase,
|
2008-03-05 17:25:23 +00:00
|
|
|
Shape& rMaster,
|
2009-07-13 08:56:32 +00:00
|
|
|
const Theme* pTheme,
|
2008-03-05 17:25:23 +00:00
|
|
|
const Reference< XShapes >& rxShapes,
|
2010-10-08 14:49:01 +02:00
|
|
|
const awt::Rectangle&,
|
2011-04-27 18:59:10 +02:00
|
|
|
ShapeIdMap* pShapeMap,
|
|
|
|
basegfx::B2DHomMatrix& aTransformation )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2011-04-27 18:59:10 +02:00
|
|
|
basegfx::B2DHomMatrix aChildTransformation;
|
2010-10-08 14:49:01 +02:00
|
|
|
|
2011-05-09 15:27:03 +02:00
|
|
|
aChildTransformation.translate(-maChPosition.X, -maChPosition.Y);
|
|
|
|
aChildTransformation.scale(1/(maChSize.Width ? maChSize.Width : 1.0), 1/(maChSize.Height ? maChSize.Height : 1.0));
|
2014-01-03 16:49:14 +01:00
|
|
|
|
|
|
|
// Child position and size is typically non-zero, but it's allowed to have
|
2014-02-18 17:28:05 +01:00
|
|
|
// it like that, and in that case Word ignores the parent transformation
|
|
|
|
// (excluding translate component).
|
2014-01-03 16:49:14 +01:00
|
|
|
if (!mbWps || maChPosition.X || maChPosition.Y || maChSize.Width || maChSize.Height)
|
2014-02-18 17:28:05 +01:00
|
|
|
{
|
2014-01-03 16:49:14 +01:00
|
|
|
aChildTransformation *= aTransformation;
|
2014-02-18 17:28:05 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
basegfx::B2DVector aScale, aTranslate;
|
|
|
|
double fRotate, fShearX;
|
|
|
|
aTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
|
|
|
|
aChildTransformation.translate(aTranslate.getX(), aTranslate.getY());
|
|
|
|
}
|
2011-05-09 15:27:03 +02:00
|
|
|
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "parent matrix:\n"
|
2014-01-03 16:49:14 +01:00
|
|
|
<< aChildTransformation.get(0, 0) << " "
|
|
|
|
<< aChildTransformation.get(0, 1) << " "
|
2013-08-20 15:50:01 +03:00
|
|
|
<< aChildTransformation.get(0, 2) << "\n"
|
2014-01-03 16:49:14 +01:00
|
|
|
<< aChildTransformation.get(1, 0) << " "
|
|
|
|
<< aChildTransformation.get(1, 1) << " "
|
|
|
|
<< aChildTransformation.get(1, 2) << "\n"
|
|
|
|
<< aChildTransformation.get(2, 0) << " "
|
|
|
|
<< aChildTransformation.get(2, 1) << " "
|
2013-08-20 15:50:01 +03:00
|
|
|
<< aChildTransformation.get(2, 2));
|
2011-05-09 15:27:03 +02:00
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
|
2012-03-02 18:01:45 +05:30
|
|
|
while( aIter != rMaster.maChildren.end() ) {
|
|
|
|
(*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
|
2013-03-12 20:37:15 +00:00
|
|
|
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), NULL, pShapeMap );
|
2012-03-02 18:01:45 +05:30
|
|
|
}
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
2008-03-05 17:25:23 +00:00
|
|
|
Reference< XShape > Shape::createAndInsert(
|
2010-08-26 18:37:44 +02:00
|
|
|
::oox::core::XmlFilterBase& rFilterBase,
|
2012-12-06 23:46:58 -02:00
|
|
|
const OUString& rServiceName,
|
2009-07-13 08:56:32 +00:00
|
|
|
const Theme* pTheme,
|
2008-03-05 17:25:23 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
2011-05-09 13:47:45 -05:00
|
|
|
const awt::Rectangle* /* pShapeRect */,
|
2014-04-01 13:41:19 +02:00
|
|
|
bool bClearText,
|
|
|
|
bool bDoNotInsertEmptyTextBody,
|
2013-03-12 20:37:15 +00:00
|
|
|
basegfx::B2DHomMatrix& aParentTransformation,
|
|
|
|
FillProperties& rShapeOrParentShapeFillProps )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2012-04-02 17:33:32 +05:30
|
|
|
bool bIsEmbMedia = false;
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << " id: " << msId);
|
2011-08-24 14:23:47 +02:00
|
|
|
|
2011-05-09 15:27:03 +02:00
|
|
|
awt::Rectangle aShapeRectHmm( maPosition.X / 360, maPosition.Y / 360, maSize.Width / 360, maSize.Height / 360 );
|
CWS-TOOLING: integrate CWS dr68
2009-06-19 17:43:48 +0200 oc r273175 : #i102946# some lines for new dialog added
2009-06-19 14:17:45 +0200 oc r273158 : #i102946# three lines added
2009-05-19 11:56:14 +0200 dr r272065 : #i99677# wrong attribute name
2009-05-18 18:37:05 +0200 dr r272045 : #i10000# suncc warning
2009-05-05 16:46:13 +0200 dr r271536 : #i10000# adoptions after rebase to master containing dr67
2009-05-05 16:01:19 +0200 dr r271530 : #i10000# adoptions after rebase to master containing dr67
2009-05-04 14:20:39 +0200 dr r271453 : CWS-TOOLING: rebase CWS dr68 to trunk@271427 (milestone: DEV300:m47)
2009-04-28 17:01:14 +0200 dr r271332 : CWS-TOOLING: rebase CWS dr68 to trunk@270723 (milestone: DEV300:m46)
2009-04-23 12:21:40 +0200 dr r271149 : #i100688# missing checkins
2009-04-23 12:18:16 +0200 dr r271147 : #i100978# relations path handling
2009-04-22 19:25:45 +0200 nn r271136 : #i49491# show navigator for double click on document position status bar control
2009-04-22 11:28:36 +0200 nn r271085 : #i60401# small text change
2009-04-21 16:53:23 +0200 dr r271044 : #i10000# missing dtor
2009-04-20 13:39:25 +0200 nn r270977 : #i60401# add dialog to extend sort range (patch from maoyg)
2009-04-08 12:11:08 +0200 dr r270630 : #i100943# prevent assertion when loading chart with empty category ranges
2009-04-07 19:03:00 +0200 dr r270609 : #i100688# missing bits for OLE
2009-04-07 17:14:06 +0200 dr r270605 : ported fix for #i100710#
2009-04-07 17:12:50 +0200 dr r270604 : #i10000# wae
2009-04-07 15:31:55 +0200 dr r270598 : import system colors moved to FilterBase class, more rework on fill and color contexts
2009-04-06 15:00:03 +0200 dr r270552 : #i99677# prevent recursive loading of the current document
2009-04-03 18:28:42 +0200 dr r270515 : added import of brightness/contrast and mono/grayscale color effects for image shapes
2009-04-03 17:36:03 +0200 dr r270509 : cache already imported embedded graphics
2009-04-03 16:46:34 +0200 dr r270500 : more rework on bitmap fill and graphic object handling
2009-03-31 12:28:10 +0200 dr r270271 : #i10000# unxlngi6 wae
2009-03-31 09:04:10 +0200 dr r270261 : CWS-TOOLING: rebase CWS dr68 to trunk@270033 (milestone: DEV300:m45)
2009-03-30 17:42:05 +0200 dr r270249 : #i91122# add missing doc
2009-03-30 17:37:08 +0200 dr r270248 : #i91122# add missing doc
2009-03-30 16:59:15 +0200 dr r270241 : #i99677# add import of ActiveX scrollbar controls
2009-03-30 14:30:36 +0200 dr r270230 : #i91122# missing/wrong documentation
2009-03-30 13:03:38 +0200 dr r270220 : #i99677# add import of ActiveX combobox and spinbutton controls
2009-03-27 11:46:59 +0100 dr r270144 : #i99677# import ActiveX listbox controls (Forms.ListBox.1)
2009-03-26 19:58:00 +0100 dr r270104 : #i99677# move more OLE import code into ole submodule
2009-03-26 15:15:02 +0100 dr r270082 : #i100546# add import of chart bitmap fills, add import of X/Y offset in tiled bitmap fills of all shapes
2009-03-25 12:54:59 +0100 dr r270018 : #i99677# import ActiveX edit text control (Forms.TextBox.1)
2009-03-24 10:59:29 +0100 dr r269921 : #i99677# moved import of OLE StdHlink to 'ole' submodule, added string import helpers to BinaryStreamBase class, removed implementation of ST_XString import from docprop in favour of the implementation in class AttributeList
2009-03-24 10:40:18 +0100 dr r269919 : #i100502# implicit precedence of '&&' was intended
2009-03-24 10:18:29 +0100 dr r269917 : #i100502# missing parentheses
2009-03-23 15:17:48 +0100 dr r269876 : #i99677# more code reorg, added graphic helper and OLE helper object per filter, added OLE/control import to PPTX/XLSX filter, moved helpers from XmlFilterBase to FilterBase
2009-03-19 12:45:20 +0100 dr r269740 : #i99677# interface changes in oox
2009-03-18 15:51:50 +0100 dr r269683 : #i99677# improved relation handling (internal/external), added preprocessor for VML streams to eat MS specific instructions, added OCX ToggleButton/OptionButton import, added DIB import for BIFF (page background picture, lots of other minor improvements
2009-03-16 15:25:30 +0100 dr r269551 : #i99677# import excel form control client data (printable, cell link)
2009-03-13 18:37:17 +0100 dr r269494 : #i99677# import image controls and check boxes
2009-03-12 15:08:18 +0100 dr r269420 : #i10000# rebase problems
2009-03-12 14:43:09 +0100 dr r269418 : #i10000# rebase problems
2009-03-12 14:42:41 +0100 dr r269417 : #i10000# missing delivered header
2009-03-12 13:57:06 +0100 dr r269405 : #i10000# typos
2009-03-12 12:58:52 +0100 dr r269391 : CWS-TOOLING: rebase CWS dr68 to trunk@269297 (milestone: DEV300:m43)
2009-03-12 11:11:46 +0100 dr r269374 : #i99677# first step to import BIFF8 page background
2009-03-12 10:21:53 +0100 dr r269364 : #i99677# rework of graphic import in entire filter, added import of AX Label controls
2009-03-09 16:44:50 +0100 dr r269202 : #i99677# import some formatting attributes of command buttons
2009-03-05 15:31:46 +0100 dr r268911 : #i99677# use VML shape client data to import excel VML shape positions
2009-03-05 11:39:48 +0100 dr r268888 : #i99677# create UNO control shapes from VML control shapes
2009-03-05 11:38:59 +0100 dr r268886 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-05 11:30:40 +0100 dr r268885 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-04 18:46:05 +0100 dr r268860 : adapt namespace ids according to oox
2009-03-04 18:43:49 +0100 dr r268859 : #i99677# more VML import rework
2009-03-03 13:38:36 +0100 dr r268721 : #i99677# more cleanup for VML filter
2009-03-03 13:13:15 +0100 dr r268719 : #i99807# do not iterate beyond end of std::list
2009-03-02 11:55:49 +0100 dr r268644 : add ST_XString support (encoded characters in attribute values)
2009-02-26 17:07:18 +0100 dr r268542 : #i99677# first steps of ax control import: dummy AX base classes, reimplement VML import (hopefully without breaking anything), register embedded AX controls at VML drawing
2009-02-23 17:43:50 +0100 dr r268365 : #i99426# remaining work on scenario import
2009-02-19 16:56:25 +0100 dr r268295 : #i99426# base implementations for scenarios import
2009-07-15 14:57:49 +00:00
|
|
|
|
2012-04-02 17:33:32 +05:30
|
|
|
OUString aServiceName;
|
2012-06-01 17:19:58 +01:00
|
|
|
if( rServiceName == "com.sun.star.drawing.GraphicObjectShape" &&
|
2012-04-02 17:33:32 +05:30
|
|
|
mpGraphicPropertiesPtr && !mpGraphicPropertiesPtr->maAudio.msEmbed.isEmpty() )
|
|
|
|
{
|
2012-06-01 17:19:58 +01:00
|
|
|
aServiceName = finalizeServiceName( rFilterBase, "com.sun.star.presentation.MediaShape", aShapeRectHmm );
|
2012-04-02 17:33:32 +05:30
|
|
|
bIsEmbMedia = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm );
|
|
|
|
}
|
2014-04-10 19:05:09 +02:00
|
|
|
bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" ||
|
|
|
|
aServiceName == "com.sun.star.drawing.ConnectorShape" );
|
2014-04-14 17:27:35 +02:00
|
|
|
bool bUseRotationTransform = ( !mbWps ||
|
|
|
|
aServiceName == "com.sun.star.drawing.LineShape" ||
|
|
|
|
aServiceName == "com.sun.star.drawing.GroupShape" );
|
2011-05-09 15:27:03 +02:00
|
|
|
|
|
|
|
basegfx::B2DHomMatrix aTransformation;
|
CWS-TOOLING: integrate CWS dr68
2009-06-19 17:43:48 +0200 oc r273175 : #i102946# some lines for new dialog added
2009-06-19 14:17:45 +0200 oc r273158 : #i102946# three lines added
2009-05-19 11:56:14 +0200 dr r272065 : #i99677# wrong attribute name
2009-05-18 18:37:05 +0200 dr r272045 : #i10000# suncc warning
2009-05-05 16:46:13 +0200 dr r271536 : #i10000# adoptions after rebase to master containing dr67
2009-05-05 16:01:19 +0200 dr r271530 : #i10000# adoptions after rebase to master containing dr67
2009-05-04 14:20:39 +0200 dr r271453 : CWS-TOOLING: rebase CWS dr68 to trunk@271427 (milestone: DEV300:m47)
2009-04-28 17:01:14 +0200 dr r271332 : CWS-TOOLING: rebase CWS dr68 to trunk@270723 (milestone: DEV300:m46)
2009-04-23 12:21:40 +0200 dr r271149 : #i100688# missing checkins
2009-04-23 12:18:16 +0200 dr r271147 : #i100978# relations path handling
2009-04-22 19:25:45 +0200 nn r271136 : #i49491# show navigator for double click on document position status bar control
2009-04-22 11:28:36 +0200 nn r271085 : #i60401# small text change
2009-04-21 16:53:23 +0200 dr r271044 : #i10000# missing dtor
2009-04-20 13:39:25 +0200 nn r270977 : #i60401# add dialog to extend sort range (patch from maoyg)
2009-04-08 12:11:08 +0200 dr r270630 : #i100943# prevent assertion when loading chart with empty category ranges
2009-04-07 19:03:00 +0200 dr r270609 : #i100688# missing bits for OLE
2009-04-07 17:14:06 +0200 dr r270605 : ported fix for #i100710#
2009-04-07 17:12:50 +0200 dr r270604 : #i10000# wae
2009-04-07 15:31:55 +0200 dr r270598 : import system colors moved to FilterBase class, more rework on fill and color contexts
2009-04-06 15:00:03 +0200 dr r270552 : #i99677# prevent recursive loading of the current document
2009-04-03 18:28:42 +0200 dr r270515 : added import of brightness/contrast and mono/grayscale color effects for image shapes
2009-04-03 17:36:03 +0200 dr r270509 : cache already imported embedded graphics
2009-04-03 16:46:34 +0200 dr r270500 : more rework on bitmap fill and graphic object handling
2009-03-31 12:28:10 +0200 dr r270271 : #i10000# unxlngi6 wae
2009-03-31 09:04:10 +0200 dr r270261 : CWS-TOOLING: rebase CWS dr68 to trunk@270033 (milestone: DEV300:m45)
2009-03-30 17:42:05 +0200 dr r270249 : #i91122# add missing doc
2009-03-30 17:37:08 +0200 dr r270248 : #i91122# add missing doc
2009-03-30 16:59:15 +0200 dr r270241 : #i99677# add import of ActiveX scrollbar controls
2009-03-30 14:30:36 +0200 dr r270230 : #i91122# missing/wrong documentation
2009-03-30 13:03:38 +0200 dr r270220 : #i99677# add import of ActiveX combobox and spinbutton controls
2009-03-27 11:46:59 +0100 dr r270144 : #i99677# import ActiveX listbox controls (Forms.ListBox.1)
2009-03-26 19:58:00 +0100 dr r270104 : #i99677# move more OLE import code into ole submodule
2009-03-26 15:15:02 +0100 dr r270082 : #i100546# add import of chart bitmap fills, add import of X/Y offset in tiled bitmap fills of all shapes
2009-03-25 12:54:59 +0100 dr r270018 : #i99677# import ActiveX edit text control (Forms.TextBox.1)
2009-03-24 10:59:29 +0100 dr r269921 : #i99677# moved import of OLE StdHlink to 'ole' submodule, added string import helpers to BinaryStreamBase class, removed implementation of ST_XString import from docprop in favour of the implementation in class AttributeList
2009-03-24 10:40:18 +0100 dr r269919 : #i100502# implicit precedence of '&&' was intended
2009-03-24 10:18:29 +0100 dr r269917 : #i100502# missing parentheses
2009-03-23 15:17:48 +0100 dr r269876 : #i99677# more code reorg, added graphic helper and OLE helper object per filter, added OLE/control import to PPTX/XLSX filter, moved helpers from XmlFilterBase to FilterBase
2009-03-19 12:45:20 +0100 dr r269740 : #i99677# interface changes in oox
2009-03-18 15:51:50 +0100 dr r269683 : #i99677# improved relation handling (internal/external), added preprocessor for VML streams to eat MS specific instructions, added OCX ToggleButton/OptionButton import, added DIB import for BIFF (page background picture, lots of other minor improvements
2009-03-16 15:25:30 +0100 dr r269551 : #i99677# import excel form control client data (printable, cell link)
2009-03-13 18:37:17 +0100 dr r269494 : #i99677# import image controls and check boxes
2009-03-12 15:08:18 +0100 dr r269420 : #i10000# rebase problems
2009-03-12 14:43:09 +0100 dr r269418 : #i10000# rebase problems
2009-03-12 14:42:41 +0100 dr r269417 : #i10000# missing delivered header
2009-03-12 13:57:06 +0100 dr r269405 : #i10000# typos
2009-03-12 12:58:52 +0100 dr r269391 : CWS-TOOLING: rebase CWS dr68 to trunk@269297 (milestone: DEV300:m43)
2009-03-12 11:11:46 +0100 dr r269374 : #i99677# first step to import BIFF8 page background
2009-03-12 10:21:53 +0100 dr r269364 : #i99677# rework of graphic import in entire filter, added import of AX Label controls
2009-03-09 16:44:50 +0100 dr r269202 : #i99677# import some formatting attributes of command buttons
2009-03-05 15:31:46 +0100 dr r268911 : #i99677# use VML shape client data to import excel VML shape positions
2009-03-05 11:39:48 +0100 dr r268888 : #i99677# create UNO control shapes from VML control shapes
2009-03-05 11:38:59 +0100 dr r268886 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-05 11:30:40 +0100 dr r268885 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-04 18:46:05 +0100 dr r268860 : adapt namespace ids according to oox
2009-03-04 18:43:49 +0100 dr r268859 : #i99677# more VML import rework
2009-03-03 13:38:36 +0100 dr r268721 : #i99677# more cleanup for VML filter
2009-03-03 13:13:15 +0100 dr r268719 : #i99807# do not iterate beyond end of std::list
2009-03-02 11:55:49 +0100 dr r268644 : add ST_XString support (encoded characters in attribute values)
2009-02-26 17:07:18 +0100 dr r268542 : #i99677# first steps of ax control import: dummy AX base classes, reimplement VML import (hopefully without breaking anything), register embedded AX controls at VML drawing
2009-02-23 17:43:50 +0100 dr r268365 : #i99426# remaining work on scenario import
2009-02-19 16:56:25 +0100 dr r268295 : #i99426# base implementations for scenarios import
2009-07-15 14:57:49 +00:00
|
|
|
|
2011-05-09 15:27:03 +02:00
|
|
|
if( maSize.Width != 1 || maSize.Height != 1)
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
// take care there are no zeros used by error
|
|
|
|
aTransformation.scale(
|
2011-05-09 15:27:03 +02:00
|
|
|
maSize.Width ? maSize.Width : 1.0,
|
|
|
|
maSize.Height ? maSize.Height : 1.0 );
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if( mbFlipH || mbFlipV || mnRotation != 0)
|
|
|
|
{
|
|
|
|
// calculate object's center
|
|
|
|
basegfx::B2DPoint aCenter(0.5, 0.5);
|
|
|
|
aCenter *= aTransformation;
|
|
|
|
|
|
|
|
// center object at origin
|
|
|
|
aTransformation.translate( -aCenter.getX(), -aCenter.getY() );
|
|
|
|
|
2010-07-02 16:52:34 +02:00
|
|
|
if( !bIsCustomShape && ( mbFlipH || mbFlipV ) )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
// mirror around object's center
|
|
|
|
aTransformation.scale( mbFlipH ? -1.0 : 1.0, mbFlipV ? -1.0 : 1.0 );
|
|
|
|
}
|
|
|
|
|
2014-04-14 17:27:35 +02:00
|
|
|
if( bUseRotationTransform && mnRotation != 0 )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
// rotate around object's center
|
2008-03-05 17:25:23 +00:00
|
|
|
aTransformation.rotate( F_PI180 * ( (double)mnRotation / 60000.0 ) );
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// move object back from center
|
|
|
|
aTransformation.translate( aCenter.getX(), aCenter.getY() );
|
|
|
|
}
|
|
|
|
|
2011-05-09 15:27:03 +02:00
|
|
|
if( maPosition.X != 0 || maPosition.Y != 0)
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
// if global position is used, add it to transformation
|
2011-05-09 15:27:03 +02:00
|
|
|
aTransformation.translate( maPosition.X, maPosition.Y );
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
2011-05-09 15:27:03 +02:00
|
|
|
aTransformation = aParentTransformation*aTransformation;
|
|
|
|
aParentTransformation = aTransformation;
|
|
|
|
aTransformation.scale(1/360.0, 1/360.0);
|
2011-04-27 18:59:10 +02:00
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
// special for lineshape
|
2012-04-06 15:05:52 +02:00
|
|
|
if ( aServiceName == "com.sun.star.drawing.LineShape" )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
::basegfx::B2DPolygon aPoly;
|
|
|
|
aPoly.insert( 0, ::basegfx::B2DPoint( 0, 0 ) );
|
|
|
|
aPoly.insert( 1, ::basegfx::B2DPoint( maSize.Width ? 1 : 0, maSize.Height ? 1 : 0 ) );
|
|
|
|
aPoly.transform( aTransformation );
|
|
|
|
|
|
|
|
// now creating the corresponding PolyPolygon
|
|
|
|
sal_Int32 i, nNumPoints = aPoly.count();
|
|
|
|
uno::Sequence< awt::Point > aPointSequence( nNumPoints );
|
|
|
|
awt::Point* pPoints = aPointSequence.getArray();
|
|
|
|
for( i = 0; i < nNumPoints; ++i )
|
|
|
|
{
|
|
|
|
const ::basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) );
|
|
|
|
pPoints[ i ] = awt::Point( static_cast< sal_Int32 >( aPoint.getX() ), static_cast< sal_Int32 >( aPoint.getY() ) );
|
|
|
|
}
|
|
|
|
uno::Sequence< uno::Sequence< awt::Point > > aPolyPolySequence( 1 );
|
|
|
|
aPolyPolySequence.getArray()[ 0 ] = aPointSequence;
|
|
|
|
|
2014-03-04 09:34:37 +01:00
|
|
|
maShapeProperties.setProperty(PROP_PolyPolygon, aPolyPolySequence);
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
2012-04-06 15:05:52 +02:00
|
|
|
else if ( aServiceName == "com.sun.star.drawing.ConnectorShape" )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
|
|
|
::basegfx::B2DPolygon aPoly;
|
|
|
|
aPoly.insert( 0, ::basegfx::B2DPoint( 0, 0 ) );
|
|
|
|
aPoly.insert( 1, ::basegfx::B2DPoint( maSize.Width ? 1 : 0, maSize.Height ? 1 : 0 ) );
|
|
|
|
aPoly.transform( aTransformation );
|
|
|
|
|
|
|
|
basegfx::B2DPoint aStartPosition( aPoly.getB2DPoint( 0 ) );
|
|
|
|
basegfx::B2DPoint aEndPosition( aPoly.getB2DPoint( 1 ) );
|
|
|
|
awt::Point aAWTStartPosition( static_cast< sal_Int32 >( aStartPosition.getX() ), static_cast< sal_Int32 >( aStartPosition.getY() ) );
|
|
|
|
awt::Point aAWTEndPosition( static_cast< sal_Int32 >( aEndPosition.getX() ), static_cast< sal_Int32 >( aEndPosition.getY() ) );
|
|
|
|
|
2014-03-04 09:34:37 +01:00
|
|
|
maShapeProperties.setProperty(PROP_StartPosition, aAWTStartPosition);
|
|
|
|
maShapeProperties.setProperty(PROP_EndPosition, aAWTEndPosition);
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// now set transformation for this object
|
|
|
|
HomogenMatrix3 aMatrix;
|
|
|
|
|
2011-04-27 18:59:10 +02:00
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
aMatrix.Line1.Column1 = aTransformation.get(0,0);
|
|
|
|
aMatrix.Line1.Column2 = aTransformation.get(0,1);
|
|
|
|
aMatrix.Line1.Column3 = aTransformation.get(0,2);
|
|
|
|
|
|
|
|
aMatrix.Line2.Column1 = aTransformation.get(1,0);
|
|
|
|
aMatrix.Line2.Column2 = aTransformation.get(1,1);
|
|
|
|
aMatrix.Line2.Column3 = aTransformation.get(1,2);
|
|
|
|
|
|
|
|
aMatrix.Line3.Column1 = aTransformation.get(2,0);
|
|
|
|
aMatrix.Line3.Column2 = aTransformation.get(2,1);
|
|
|
|
aMatrix.Line3.Column3 = aTransformation.get(2,2);
|
|
|
|
|
2014-03-04 09:34:37 +01:00
|
|
|
maShapeProperties.setProperty(PROP_Transformation, aMatrix);
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
2011-04-27 18:59:10 +02:00
|
|
|
|
2008-03-05 17:25:23 +00:00
|
|
|
Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
|
2008-06-20 05:54:51 +00:00
|
|
|
if ( !mxShape.is() )
|
CWS-TOOLING: integrate CWS dr68
2009-06-19 17:43:48 +0200 oc r273175 : #i102946# some lines for new dialog added
2009-06-19 14:17:45 +0200 oc r273158 : #i102946# three lines added
2009-05-19 11:56:14 +0200 dr r272065 : #i99677# wrong attribute name
2009-05-18 18:37:05 +0200 dr r272045 : #i10000# suncc warning
2009-05-05 16:46:13 +0200 dr r271536 : #i10000# adoptions after rebase to master containing dr67
2009-05-05 16:01:19 +0200 dr r271530 : #i10000# adoptions after rebase to master containing dr67
2009-05-04 14:20:39 +0200 dr r271453 : CWS-TOOLING: rebase CWS dr68 to trunk@271427 (milestone: DEV300:m47)
2009-04-28 17:01:14 +0200 dr r271332 : CWS-TOOLING: rebase CWS dr68 to trunk@270723 (milestone: DEV300:m46)
2009-04-23 12:21:40 +0200 dr r271149 : #i100688# missing checkins
2009-04-23 12:18:16 +0200 dr r271147 : #i100978# relations path handling
2009-04-22 19:25:45 +0200 nn r271136 : #i49491# show navigator for double click on document position status bar control
2009-04-22 11:28:36 +0200 nn r271085 : #i60401# small text change
2009-04-21 16:53:23 +0200 dr r271044 : #i10000# missing dtor
2009-04-20 13:39:25 +0200 nn r270977 : #i60401# add dialog to extend sort range (patch from maoyg)
2009-04-08 12:11:08 +0200 dr r270630 : #i100943# prevent assertion when loading chart with empty category ranges
2009-04-07 19:03:00 +0200 dr r270609 : #i100688# missing bits for OLE
2009-04-07 17:14:06 +0200 dr r270605 : ported fix for #i100710#
2009-04-07 17:12:50 +0200 dr r270604 : #i10000# wae
2009-04-07 15:31:55 +0200 dr r270598 : import system colors moved to FilterBase class, more rework on fill and color contexts
2009-04-06 15:00:03 +0200 dr r270552 : #i99677# prevent recursive loading of the current document
2009-04-03 18:28:42 +0200 dr r270515 : added import of brightness/contrast and mono/grayscale color effects for image shapes
2009-04-03 17:36:03 +0200 dr r270509 : cache already imported embedded graphics
2009-04-03 16:46:34 +0200 dr r270500 : more rework on bitmap fill and graphic object handling
2009-03-31 12:28:10 +0200 dr r270271 : #i10000# unxlngi6 wae
2009-03-31 09:04:10 +0200 dr r270261 : CWS-TOOLING: rebase CWS dr68 to trunk@270033 (milestone: DEV300:m45)
2009-03-30 17:42:05 +0200 dr r270249 : #i91122# add missing doc
2009-03-30 17:37:08 +0200 dr r270248 : #i91122# add missing doc
2009-03-30 16:59:15 +0200 dr r270241 : #i99677# add import of ActiveX scrollbar controls
2009-03-30 14:30:36 +0200 dr r270230 : #i91122# missing/wrong documentation
2009-03-30 13:03:38 +0200 dr r270220 : #i99677# add import of ActiveX combobox and spinbutton controls
2009-03-27 11:46:59 +0100 dr r270144 : #i99677# import ActiveX listbox controls (Forms.ListBox.1)
2009-03-26 19:58:00 +0100 dr r270104 : #i99677# move more OLE import code into ole submodule
2009-03-26 15:15:02 +0100 dr r270082 : #i100546# add import of chart bitmap fills, add import of X/Y offset in tiled bitmap fills of all shapes
2009-03-25 12:54:59 +0100 dr r270018 : #i99677# import ActiveX edit text control (Forms.TextBox.1)
2009-03-24 10:59:29 +0100 dr r269921 : #i99677# moved import of OLE StdHlink to 'ole' submodule, added string import helpers to BinaryStreamBase class, removed implementation of ST_XString import from docprop in favour of the implementation in class AttributeList
2009-03-24 10:40:18 +0100 dr r269919 : #i100502# implicit precedence of '&&' was intended
2009-03-24 10:18:29 +0100 dr r269917 : #i100502# missing parentheses
2009-03-23 15:17:48 +0100 dr r269876 : #i99677# more code reorg, added graphic helper and OLE helper object per filter, added OLE/control import to PPTX/XLSX filter, moved helpers from XmlFilterBase to FilterBase
2009-03-19 12:45:20 +0100 dr r269740 : #i99677# interface changes in oox
2009-03-18 15:51:50 +0100 dr r269683 : #i99677# improved relation handling (internal/external), added preprocessor for VML streams to eat MS specific instructions, added OCX ToggleButton/OptionButton import, added DIB import for BIFF (page background picture, lots of other minor improvements
2009-03-16 15:25:30 +0100 dr r269551 : #i99677# import excel form control client data (printable, cell link)
2009-03-13 18:37:17 +0100 dr r269494 : #i99677# import image controls and check boxes
2009-03-12 15:08:18 +0100 dr r269420 : #i10000# rebase problems
2009-03-12 14:43:09 +0100 dr r269418 : #i10000# rebase problems
2009-03-12 14:42:41 +0100 dr r269417 : #i10000# missing delivered header
2009-03-12 13:57:06 +0100 dr r269405 : #i10000# typos
2009-03-12 12:58:52 +0100 dr r269391 : CWS-TOOLING: rebase CWS dr68 to trunk@269297 (milestone: DEV300:m43)
2009-03-12 11:11:46 +0100 dr r269374 : #i99677# first step to import BIFF8 page background
2009-03-12 10:21:53 +0100 dr r269364 : #i99677# rework of graphic import in entire filter, added import of AX Label controls
2009-03-09 16:44:50 +0100 dr r269202 : #i99677# import some formatting attributes of command buttons
2009-03-05 15:31:46 +0100 dr r268911 : #i99677# use VML shape client data to import excel VML shape positions
2009-03-05 11:39:48 +0100 dr r268888 : #i99677# create UNO control shapes from VML control shapes
2009-03-05 11:38:59 +0100 dr r268886 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-05 11:30:40 +0100 dr r268885 : #i99677# change attribute Shapes to DrawPage for import of embedded form controls
2009-03-04 18:46:05 +0100 dr r268860 : adapt namespace ids according to oox
2009-03-04 18:43:49 +0100 dr r268859 : #i99677# more VML import rework
2009-03-03 13:38:36 +0100 dr r268721 : #i99677# more cleanup for VML filter
2009-03-03 13:13:15 +0100 dr r268719 : #i99807# do not iterate beyond end of std::list
2009-03-02 11:55:49 +0100 dr r268644 : add ST_XString support (encoded characters in attribute values)
2009-02-26 17:07:18 +0100 dr r268542 : #i99677# first steps of ax control import: dummy AX base classes, reimplement VML import (hopefully without breaking anything), register embedded AX controls at VML drawing
2009-02-23 17:43:50 +0100 dr r268365 : #i99426# remaining work on scenario import
2009-02-19 16:56:25 +0100 dr r268295 : #i99426# base implementations for scenarios import
2009-07-15 14:57:49 +00:00
|
|
|
mxShape = Reference< drawing::XShape >( xServiceFact->createInstance( aServiceName ), UNO_QUERY_THROW );
|
2008-03-05 17:25:23 +00:00
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
Reference< XPropertySet > xSet( mxShape, UNO_QUERY );
|
2008-06-20 05:54:51 +00:00
|
|
|
if( mxShape.is() && xSet.is() )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2012-01-01 12:55:53 -02:00
|
|
|
if( !msName.isEmpty() )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2008-06-20 05:54:51 +00:00
|
|
|
Reference< container::XNamed > xNamed( mxShape, UNO_QUERY );
|
2008-01-17 07:06:10 +00:00
|
|
|
if( xNamed.is() )
|
|
|
|
xNamed->setName( msName );
|
|
|
|
}
|
2013-11-26 14:32:21 +01:00
|
|
|
if (aServiceName != "com.sun.star.text.TextFrame")
|
|
|
|
rxShapes->add( mxShape );
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2011-08-24 14:23:47 +02:00
|
|
|
if ( mbHidden || mbHiddenMasterShape )
|
2010-03-16 15:59:04 +01:00
|
|
|
{
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "invisible shape with id: " << msId);
|
2013-01-04 15:39:44 +01:00
|
|
|
const OUString sVisible( "Visible" );
|
2011-08-24 14:23:47 +02:00
|
|
|
xSet->setPropertyValue( sVisible, Any( sal_False ) );
|
2010-03-16 15:59:04 +01:00
|
|
|
}
|
|
|
|
|
2012-03-01 22:24:04 +01:00
|
|
|
ActionLockGuard const alg(mxShape);
|
2010-05-10 11:54:37 +02:00
|
|
|
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 17:01:07 +00:00
|
|
|
// sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape
|
|
|
|
if ( bClearText )
|
|
|
|
{
|
|
|
|
uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
|
|
|
|
if ( xText.is() )
|
|
|
|
{
|
|
|
|
OUString aEmpty;
|
|
|
|
xText->setString( aEmpty );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-14 17:31:33 +02:00
|
|
|
const GraphicHelper& rGraphicHelper = rFilterBase.getGraphicHelper();
|
|
|
|
|
2008-03-05 17:25:23 +00:00
|
|
|
LineProperties aLineProperties;
|
2008-09-30 13:51:36 +00:00
|
|
|
aLineProperties.maLineFill.moFillType = XML_noFill;
|
2008-07-22 12:40:31 +00:00
|
|
|
sal_Int32 nLinePhClr = -1;
|
2008-03-05 17:25:23 +00:00
|
|
|
FillProperties aFillProperties;
|
2008-09-30 13:51:36 +00:00
|
|
|
aFillProperties.moFillType = XML_noFill;
|
2008-07-22 12:40:31 +00:00
|
|
|
sal_Int32 nFillPhClr = -1;
|
2012-09-26 12:22:17 +01:00
|
|
|
EffectProperties aEffectProperties;
|
2012-12-11 15:35:43 +01:00
|
|
|
// TODO: use ph color when applying effect properties
|
|
|
|
//sal_Int32 nEffectPhClr = -1;
|
2008-07-22 12:40:31 +00:00
|
|
|
|
2009-07-13 08:56:32 +00:00
|
|
|
if( pTheme )
|
2008-07-22 12:40:31 +00:00
|
|
|
{
|
|
|
|
if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) )
|
|
|
|
{
|
2009-07-13 08:56:32 +00:00
|
|
|
if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) )
|
2008-07-22 12:40:31 +00:00
|
|
|
aLineProperties.assignUsed( *pLineProps );
|
2010-04-14 17:31:33 +02:00
|
|
|
nLinePhClr = pLineRef->maPhClr.getColor( rGraphicHelper );
|
2014-01-27 19:46:37 +01:00
|
|
|
|
|
|
|
// Store style-related properties to InteropGrabBag to be able to export them back
|
|
|
|
Sequence< PropertyValue > aProperties( 7 );
|
|
|
|
PUT_PROP( aProperties, 0, "SchemeClr", pLineRef->maPhClr.getSchemeName() );
|
|
|
|
PUT_PROP( aProperties, 1, "Idx", pLineRef->mnThemedIdx );
|
|
|
|
PUT_PROP( aProperties, 2, "Color", nLinePhClr );
|
|
|
|
PUT_PROP( aProperties, 3, "LineStyle", aLineProperties.getLineStyle() );
|
|
|
|
PUT_PROP( aProperties, 4, "LineJoint", aLineProperties.getLineJoint() );
|
|
|
|
PUT_PROP( aProperties, 5, "LineWidth", aLineProperties.getLineWidth() );
|
|
|
|
PUT_PROP( aProperties, 6, "Transformations", pLineRef->maPhClr.getTransformations() );
|
2014-01-28 13:51:16 +01:00
|
|
|
putPropertyToGrabBag( "StyleLnRef", Any( aProperties ) );
|
2008-07-22 12:40:31 +00:00
|
|
|
}
|
|
|
|
if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) )
|
|
|
|
{
|
2009-07-13 08:56:32 +00:00
|
|
|
if( const FillProperties* pFillProps = pTheme->getFillStyle( pFillRef->mnThemedIdx ) )
|
2008-07-22 12:40:31 +00:00
|
|
|
aFillProperties.assignUsed( *pFillProps );
|
2010-04-14 17:31:33 +02:00
|
|
|
nFillPhClr = pFillRef->maPhClr.getColor( rGraphicHelper );
|
2014-01-14 18:43:06 +01:00
|
|
|
|
|
|
|
OUString sColorScheme = pFillRef->maPhClr.getSchemeName();
|
|
|
|
if( !sColorScheme.isEmpty() )
|
|
|
|
{
|
2014-01-27 19:32:55 +01:00
|
|
|
Sequence< PropertyValue > aProperties(4);
|
2014-01-28 13:51:16 +01:00
|
|
|
PUT_PROP( aProperties, 0, "SchemeClr", sColorScheme );
|
|
|
|
PUT_PROP( aProperties, 1, "Idx", pFillRef->mnThemedIdx );
|
|
|
|
PUT_PROP( aProperties, 2, "Color", nFillPhClr );
|
|
|
|
PUT_PROP( aProperties, 3, "Transformations", pFillRef->maPhClr.getTransformations() );
|
|
|
|
|
|
|
|
putPropertyToGrabBag( "StyleFillRef", Any( aProperties ) );
|
2014-01-14 18:43:06 +01:00
|
|
|
}
|
2008-07-22 12:40:31 +00:00
|
|
|
}
|
2012-12-11 15:35:43 +01:00
|
|
|
if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_effectRef ) )
|
|
|
|
{
|
|
|
|
if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
|
|
|
|
aEffectProperties.assignUsed( *pEffectProps );
|
|
|
|
// TODO: use ph color when applying effect properties
|
|
|
|
// nEffectPhClr = pEffectRef->maPhClr.getColor( rGraphicHelper );
|
2014-01-28 13:39:11 +01:00
|
|
|
|
|
|
|
// Store style-related properties to InteropGrabBag to be able to export them back
|
|
|
|
Sequence< PropertyValue > aProperties( 3 );
|
|
|
|
PUT_PROP( aProperties, 0, "SchemeClr", pEffectRef->maPhClr.getSchemeName() );
|
|
|
|
PUT_PROP( aProperties, 1, "Idx", pEffectRef->mnThemedIdx );
|
|
|
|
PUT_PROP( aProperties, 2, "Transformations", pEffectRef->maPhClr.getTransformations() );
|
2014-01-28 13:51:16 +01:00
|
|
|
putPropertyToGrabBag( "StyleEffectRef", Any( aProperties ) );
|
2012-12-11 15:35:43 +01:00
|
|
|
}
|
2008-07-22 12:40:31 +00:00
|
|
|
}
|
2008-03-05 17:25:23 +00:00
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
aLineProperties.assignUsed( getLineProperties() );
|
2013-03-12 20:37:15 +00:00
|
|
|
|
|
|
|
// group fill inherits from parent
|
|
|
|
if ( getFillProperties().moFillType.has() && getFillProperties().moFillType.get() == XML_grpFill )
|
2013-07-01 17:04:12 +08:00
|
|
|
getFillProperties().assignUsed( rShapeOrParentShapeFillProps );
|
|
|
|
aFillProperties.assignUsed( getFillProperties() );
|
2012-09-26 12:22:17 +01:00
|
|
|
aEffectProperties.assignUsed ( getEffectProperties() );
|
2008-03-05 17:25:23 +00:00
|
|
|
|
2011-01-11 13:26:59 +01:00
|
|
|
ShapePropertyMap aShapeProps( rFilterBase.getModelObjectHelper() );
|
2010-03-31 19:23:34 +02:00
|
|
|
|
2008-07-22 12:40:31 +00:00
|
|
|
// add properties from textbody to shape properties
|
|
|
|
if( mpTextBody.get() )
|
2012-08-16 16:57:47 +05:30
|
|
|
{
|
|
|
|
mpTextBody->getTextProperties().pushRotationAdjustments( mnRotation );
|
2011-01-11 13:26:59 +01:00
|
|
|
aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap );
|
2013-08-16 17:46:44 +05:30
|
|
|
// Push char properties as well - specifically useful when this is a placeholder
|
|
|
|
if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.has() )
|
2014-03-04 09:34:37 +01:00
|
|
|
aShapeProps.setProperty(PROP_CharHeight, GetFontHeight( mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.get() ));
|
2012-08-16 16:57:47 +05:30
|
|
|
}
|
2010-10-08 22:28:39 +02:00
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
// applying properties
|
2011-01-11 13:26:59 +01:00
|
|
|
aShapeProps.assignUsed( getShapeProperties() );
|
2011-04-27 01:31:35 +02:00
|
|
|
aShapeProps.assignUsed( maDefaultShapeProperties );
|
2013-01-29 10:42:46 +01:00
|
|
|
if ( bIsEmbMedia || aServiceName == "com.sun.star.drawing.GraphicObjectShape" || aServiceName == "com.sun.star.drawing.OLE2Shape" )
|
2011-01-11 13:26:59 +01:00
|
|
|
mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper );
|
2012-06-01 17:19:58 +01:00
|
|
|
if ( mpTablePropertiesPtr.get() && aServiceName == "com.sun.star.drawing.TableShape" )
|
2008-06-20 05:54:51 +00:00
|
|
|
mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle );
|
2012-12-19 20:03:51 +05:30
|
|
|
aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr, mbFlipH, mbFlipV );
|
2011-01-11 13:26:59 +01:00
|
|
|
aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr );
|
2012-12-11 15:35:43 +01:00
|
|
|
// TODO: use ph color when applying effect properties
|
2012-09-26 12:22:17 +01:00
|
|
|
aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper );
|
2008-01-17 07:06:10 +00:00
|
|
|
|
|
|
|
// applying autogrowheight property before setting shape size, because
|
|
|
|
// the shape size might be changed if currently autogrowheight is true
|
|
|
|
// we must also check that the PropertySet supports the property.
|
|
|
|
Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
|
CWS-TOOLING: integrate CWS dr67
2009-04-08 13:23:56 +0200 dr r270638 : #i100534# reverted
2009-04-08 10:14:55 +0200 dr r270621 : CWS-TOOLING: rebase CWS dr67 to trunk@270033 (milestone: DEV300:m45)
2009-04-07 21:06:33 +0200 dr r270610 : #i100534# sc does not link in debug mode
2009-03-12 11:20:09 +0100 dr r269375 : #i10000# wae
2009-03-11 19:43:55 +0100 dr r269351 : #i10000# adjust oox namespace ids according to oox/inc/oox/core/namespaces.hxx
2009-03-11 15:38:52 +0100 dr r269339 : CWS-TOOLING: rebase CWS dr67 to trunk@269297 (milestone: DEV300:m43)
2009-02-27 15:20:21 +0100 dr r268598 : CWS-TOOLING: rebase CWS dr67 to trunk@268395 (milestone: DEV300:m42)
2009-02-19 13:32:17 +0100 dr r268277 : moved hf parser into page settings
2009-02-19 12:25:15 +0100 dr r268272 : renamed some structs according to chart filter
2009-02-16 15:51:31 +0100 dr r267823 : #i97873# import autosort settings from BIFF8/OOBIN/OOXML
2009-02-06 17:09:29 +0100 dr r267477 : #i97873# minor changes
2009-02-06 16:38:56 +0100 dr r267473 : #i97873# import date grouping settings from BIFF5/BIFF8/OOBIN/OOXML
2009-02-06 16:38:11 +0100 dr r267472 : #i97873# check min/max/step of passed GroupInfo
2009-02-06 16:35:13 +0100 dr r267471 : #i97873# more doc for createDategroup()
2009-02-06 13:53:42 +0100 dr r267459 : #i97873# make XDataPilotGrouping::createDateGroup() implementation working and robust against wrong input data
2009-02-06 13:52:16 +0100 dr r267458 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-06 12:35:49 +0100 dr r267453 : fix other IDLC warnings in sheet module
2009-02-06 12:05:19 +0100 dr r267448 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-02 17:58:46 +0100 dr r267284 : #i10000# rebase errors
2009-02-02 17:52:21 +0100 dr r267282 : #i10000# rebase errors
2009-02-02 17:35:58 +0100 dr r267280 : #i10000# rebase errors
2009-02-02 15:58:04 +0100 dr r267274 : CWS-TOOLING: rebase CWS dr67 to trunk@267171 (milestone: DEV300:m41)
2009-02-02 09:16:32 +0100 dr r267247 : #i97873# typo
2009-01-30 17:09:09 +0100 dr r267215 : #i97873# import numeric grouping settings for datapilot fields from BIFF5/BIFF8/OOBIN/OOXML
2009-01-29 16:36:24 +0100 dr r267154 : #i97873# import datapilot discrete grouping from BIFF5/BIFF8/OOBIN/OOXLS
2009-01-29 16:33:37 +0100 dr r267152 : #i97873# do not kill _all_ the other group fields when writing back DataPilotField::GroupInfo property
2009-01-29 14:15:45 +0100 dr r267133 : #i93839# remove ScChengeTrack::Load and ::Store, adapt xls export filter
2009-01-28 13:30:37 +0100 dr r267056 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-28 12:09:05 +0100 dr r267051 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-27 16:13:58 +0100 dr r267005 : #i97873# minor changes in DataPilot API implementation as preparation for additional changes needed for OOX import filter
2009-01-27 10:08:01 +0100 dr r266961 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-27 10:06:50 +0100 dr r266960 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-23 12:52:31 +0100 dr r266808 : #i97873# DP documentation extended
2009-01-21 20:07:15 +0100 dr r266702 : #i97873# this trivial patch adds BIFF5/BIFF8 pivot table import to the oox filter
2009-01-20 16:06:23 +0100 dr r266592 : select BIFF filter via env.var
2009-01-16 18:51:01 +0100 dr r266452 : #i97873# import page fields
2009-01-16 15:05:36 +0100 dr r266420 : #i97873# field item settings (collapsed/hidden), settings of hidden fields
2009-01-15 16:01:17 +0100 dr r266377 : #i97873# import OOXML7/OOBIN7 autoshow settings
2009-01-14 15:24:27 +0100 dr r266310 : #i97873# import auto show settings generated by MSO2003
2009-01-14 12:29:44 +0100 dr r266281 : #i97873# set global dp settings
2009-01-13 15:04:30 +0100 dr r266229 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-13 14:46:50 +0100 dr r266225 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-12 15:04:22 +0100 dr r266161 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 15:03:42 +0100 dr r266160 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 14:57:33 +0100 dr r266159 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-12 14:52:43 +0100 dr r266158 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-09 16:34:55 +0100 dr r266098 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 16:32:16 +0100 dr r266097 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 12:02:39 +0100 dr r266072 : #i97623# RTL handling changed after CWS rtlcontrols
2009-01-09 09:48:53 +0100 dr r266050 : #i158444# SXLI must be filled completely before starting CONTINUE
2009-01-08 18:50:08 +0100 dr r266032 : #158444# allow to disable dump of record positions
2009-01-08 15:46:45 +0100 dr r266020 : #i97873# data layout field handling
2009-01-08 15:45:45 +0100 dr r266019 : #i97873# data layout field handling
2009-01-08 15:42:25 +0100 dr r266018 : #i97873# data layout field handling
2009-01-02 17:28:32 +0100 dr r265844 : #i10000# unxmacxi warning
2009-01-02 16:59:13 +0100 dr r265842 : #i10000# rebase corrections
2009-01-02 16:44:44 +0100 dr r265838 : #i10000# rebase corrections
2009-01-02 11:32:44 +0100 dr r265834 : CWS-TOOLING: rebase CWS dr67 to trunk@265758 (milestone: DEV300:m38)
2008-12-29 16:55:40 +0100 dr r265822 : more pivot table import, field layout settings
2008-12-29 14:27:35 +0100 dr r265817 : more pivot table import, additions for data field settings
2008-12-26 14:39:21 +0100 dr r265805 : updates
2008-12-19 16:31:39 +0100 dr r265734 : typo
2008-12-19 16:30:00 +0100 dr r265733 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:43 +0100 dr r265732 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:07 +0100 dr r265731 : add API for sequence of DP field subtotal functions
2008-12-18 18:07:58 +0100 dr r265710 : #i96758# try to cache row default formatting and apply it at row ranges instead of single rows
2008-12-18 16:00:25 +0100 dr r265698 : more additions to pivot import
2008-12-17 13:38:19 +0100 dr r265599 : do not assert HIDDEN orientation
2008-12-12 13:51:29 +0100 dr r265415 : minor typos
2008-12-12 10:15:04 +0100 dr r265394 : pivot cache import extended to XLSB, added creation of cache data for missing/external sheets
2008-12-04 13:16:16 +0100 dr r264837 : #i96860# remove old dumper files
2008-12-04 12:17:38 +0100 dr r264834 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-04 12:16:38 +0100 dr r264833 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-03 14:51:05 +0100 dr r264784 : #i10000# warnings
2008-12-03 14:32:46 +0100 dr r264778 : #i10000# warning
2008-12-03 11:28:38 +0100 dr r264758 : #i96758# ignore zero-sized objects
2008-12-03 10:09:34 +0100 dr r264748 : #i96758# change ::oox::Property(Set|Map) keys to sal_Int32 property identifiers, to save construction of property names
2008-12-01 16:09:02 +0100 dr r264615 : #i96758# headerdoc
2008-12-01 14:49:04 +0100 dr r264607 : #i96758# import performance of formatted documents
2008-11-26 17:08:15 +0100 dr r264424 : make it more simple
2008-11-26 16:31:41 +0100 dr r264419 : c:crossesAt is for crossing axis, not for own axis. This is different to BIFF
2008-11-26 13:55:55 +0100 dr r264382 : #i86346# import of MissingValueTreatment from XLSX
2008-11-26 12:49:38 +0100 dr r264370 : #i86346# import/export of MissingValueTreatment from/to XLS
2008-11-25 17:48:59 +0100 dr r264320 : update row height with single progress bar when using 'IsAdjustHeightEnabled' document property
2008-11-25 17:24:26 +0100 dr r264319 : #i96438# disable importing comment text until API is fixed
2008-11-25 17:11:30 +0100 dr r264318 : #i90124# set control tooltips, patch from npower
2008-11-25 15:09:28 +0100 dr r264309 : #i94028# #i94991# update drawing objects when changing row height
2008-11-24 15:21:35 +0100 dr r264224 : prevent ::rtl::OUString::copy assertion
2008-11-24 15:19:39 +0100 dr r264223 : #i95183# #158573# handle non-ascii characters in sheet names in OOXML import
2008-11-24 12:54:30 +0100 dr r264221 : #i94157# support ESC key to leave full-screen in page preview
2008-11-21 18:15:17 +0100 dr r264165 : #i90360# disable chart perspective if it is set to 0
2008-11-21 18:14:41 +0100 dr r264164 : #i90360# disable chart perspective if it is set to 0
2008-11-21 17:43:26 +0100 dr r264155 : #i96140# missing parenth
2008-11-21 17:36:35 +0100 dr r264154 : #i96438# first steps of note import
2008-11-20 15:15:03 +0100 dr r264059 : get rid of ContextWrapper
2008-11-18 11:39:52 +0100 dr r263755 : #i78476# moved to CWS dr67
2009-04-22 10:06:26 +00:00
|
|
|
const OUString& rPropName = PropertyMap::getPropertyName( PROP_TextAutoGrowHeight );
|
|
|
|
if( xSetInfo.is() && xSetInfo->hasPropertyByName( rPropName ) )
|
2011-01-11 13:26:59 +01:00
|
|
|
if( aShapeProps.hasProperty( PROP_TextAutoGrowHeight ) )
|
CWS-TOOLING: integrate CWS dr67
2009-04-08 13:23:56 +0200 dr r270638 : #i100534# reverted
2009-04-08 10:14:55 +0200 dr r270621 : CWS-TOOLING: rebase CWS dr67 to trunk@270033 (milestone: DEV300:m45)
2009-04-07 21:06:33 +0200 dr r270610 : #i100534# sc does not link in debug mode
2009-03-12 11:20:09 +0100 dr r269375 : #i10000# wae
2009-03-11 19:43:55 +0100 dr r269351 : #i10000# adjust oox namespace ids according to oox/inc/oox/core/namespaces.hxx
2009-03-11 15:38:52 +0100 dr r269339 : CWS-TOOLING: rebase CWS dr67 to trunk@269297 (milestone: DEV300:m43)
2009-02-27 15:20:21 +0100 dr r268598 : CWS-TOOLING: rebase CWS dr67 to trunk@268395 (milestone: DEV300:m42)
2009-02-19 13:32:17 +0100 dr r268277 : moved hf parser into page settings
2009-02-19 12:25:15 +0100 dr r268272 : renamed some structs according to chart filter
2009-02-16 15:51:31 +0100 dr r267823 : #i97873# import autosort settings from BIFF8/OOBIN/OOXML
2009-02-06 17:09:29 +0100 dr r267477 : #i97873# minor changes
2009-02-06 16:38:56 +0100 dr r267473 : #i97873# import date grouping settings from BIFF5/BIFF8/OOBIN/OOXML
2009-02-06 16:38:11 +0100 dr r267472 : #i97873# check min/max/step of passed GroupInfo
2009-02-06 16:35:13 +0100 dr r267471 : #i97873# more doc for createDategroup()
2009-02-06 13:53:42 +0100 dr r267459 : #i97873# make XDataPilotGrouping::createDateGroup() implementation working and robust against wrong input data
2009-02-06 13:52:16 +0100 dr r267458 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-06 12:35:49 +0100 dr r267453 : fix other IDLC warnings in sheet module
2009-02-06 12:05:19 +0100 dr r267448 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-02 17:58:46 +0100 dr r267284 : #i10000# rebase errors
2009-02-02 17:52:21 +0100 dr r267282 : #i10000# rebase errors
2009-02-02 17:35:58 +0100 dr r267280 : #i10000# rebase errors
2009-02-02 15:58:04 +0100 dr r267274 : CWS-TOOLING: rebase CWS dr67 to trunk@267171 (milestone: DEV300:m41)
2009-02-02 09:16:32 +0100 dr r267247 : #i97873# typo
2009-01-30 17:09:09 +0100 dr r267215 : #i97873# import numeric grouping settings for datapilot fields from BIFF5/BIFF8/OOBIN/OOXML
2009-01-29 16:36:24 +0100 dr r267154 : #i97873# import datapilot discrete grouping from BIFF5/BIFF8/OOBIN/OOXLS
2009-01-29 16:33:37 +0100 dr r267152 : #i97873# do not kill _all_ the other group fields when writing back DataPilotField::GroupInfo property
2009-01-29 14:15:45 +0100 dr r267133 : #i93839# remove ScChengeTrack::Load and ::Store, adapt xls export filter
2009-01-28 13:30:37 +0100 dr r267056 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-28 12:09:05 +0100 dr r267051 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-27 16:13:58 +0100 dr r267005 : #i97873# minor changes in DataPilot API implementation as preparation for additional changes needed for OOX import filter
2009-01-27 10:08:01 +0100 dr r266961 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-27 10:06:50 +0100 dr r266960 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-23 12:52:31 +0100 dr r266808 : #i97873# DP documentation extended
2009-01-21 20:07:15 +0100 dr r266702 : #i97873# this trivial patch adds BIFF5/BIFF8 pivot table import to the oox filter
2009-01-20 16:06:23 +0100 dr r266592 : select BIFF filter via env.var
2009-01-16 18:51:01 +0100 dr r266452 : #i97873# import page fields
2009-01-16 15:05:36 +0100 dr r266420 : #i97873# field item settings (collapsed/hidden), settings of hidden fields
2009-01-15 16:01:17 +0100 dr r266377 : #i97873# import OOXML7/OOBIN7 autoshow settings
2009-01-14 15:24:27 +0100 dr r266310 : #i97873# import auto show settings generated by MSO2003
2009-01-14 12:29:44 +0100 dr r266281 : #i97873# set global dp settings
2009-01-13 15:04:30 +0100 dr r266229 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-13 14:46:50 +0100 dr r266225 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-12 15:04:22 +0100 dr r266161 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 15:03:42 +0100 dr r266160 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 14:57:33 +0100 dr r266159 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-12 14:52:43 +0100 dr r266158 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-09 16:34:55 +0100 dr r266098 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 16:32:16 +0100 dr r266097 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 12:02:39 +0100 dr r266072 : #i97623# RTL handling changed after CWS rtlcontrols
2009-01-09 09:48:53 +0100 dr r266050 : #i158444# SXLI must be filled completely before starting CONTINUE
2009-01-08 18:50:08 +0100 dr r266032 : #158444# allow to disable dump of record positions
2009-01-08 15:46:45 +0100 dr r266020 : #i97873# data layout field handling
2009-01-08 15:45:45 +0100 dr r266019 : #i97873# data layout field handling
2009-01-08 15:42:25 +0100 dr r266018 : #i97873# data layout field handling
2009-01-02 17:28:32 +0100 dr r265844 : #i10000# unxmacxi warning
2009-01-02 16:59:13 +0100 dr r265842 : #i10000# rebase corrections
2009-01-02 16:44:44 +0100 dr r265838 : #i10000# rebase corrections
2009-01-02 11:32:44 +0100 dr r265834 : CWS-TOOLING: rebase CWS dr67 to trunk@265758 (milestone: DEV300:m38)
2008-12-29 16:55:40 +0100 dr r265822 : more pivot table import, field layout settings
2008-12-29 14:27:35 +0100 dr r265817 : more pivot table import, additions for data field settings
2008-12-26 14:39:21 +0100 dr r265805 : updates
2008-12-19 16:31:39 +0100 dr r265734 : typo
2008-12-19 16:30:00 +0100 dr r265733 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:43 +0100 dr r265732 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:07 +0100 dr r265731 : add API for sequence of DP field subtotal functions
2008-12-18 18:07:58 +0100 dr r265710 : #i96758# try to cache row default formatting and apply it at row ranges instead of single rows
2008-12-18 16:00:25 +0100 dr r265698 : more additions to pivot import
2008-12-17 13:38:19 +0100 dr r265599 : do not assert HIDDEN orientation
2008-12-12 13:51:29 +0100 dr r265415 : minor typos
2008-12-12 10:15:04 +0100 dr r265394 : pivot cache import extended to XLSB, added creation of cache data for missing/external sheets
2008-12-04 13:16:16 +0100 dr r264837 : #i96860# remove old dumper files
2008-12-04 12:17:38 +0100 dr r264834 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-04 12:16:38 +0100 dr r264833 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-03 14:51:05 +0100 dr r264784 : #i10000# warnings
2008-12-03 14:32:46 +0100 dr r264778 : #i10000# warning
2008-12-03 11:28:38 +0100 dr r264758 : #i96758# ignore zero-sized objects
2008-12-03 10:09:34 +0100 dr r264748 : #i96758# change ::oox::Property(Set|Map) keys to sal_Int32 property identifiers, to save construction of property names
2008-12-01 16:09:02 +0100 dr r264615 : #i96758# headerdoc
2008-12-01 14:49:04 +0100 dr r264607 : #i96758# import performance of formatted documents
2008-11-26 17:08:15 +0100 dr r264424 : make it more simple
2008-11-26 16:31:41 +0100 dr r264419 : c:crossesAt is for crossing axis, not for own axis. This is different to BIFF
2008-11-26 13:55:55 +0100 dr r264382 : #i86346# import of MissingValueTreatment from XLSX
2008-11-26 12:49:38 +0100 dr r264370 : #i86346# import/export of MissingValueTreatment from/to XLS
2008-11-25 17:48:59 +0100 dr r264320 : update row height with single progress bar when using 'IsAdjustHeightEnabled' document property
2008-11-25 17:24:26 +0100 dr r264319 : #i96438# disable importing comment text until API is fixed
2008-11-25 17:11:30 +0100 dr r264318 : #i90124# set control tooltips, patch from npower
2008-11-25 15:09:28 +0100 dr r264309 : #i94028# #i94991# update drawing objects when changing row height
2008-11-24 15:21:35 +0100 dr r264224 : prevent ::rtl::OUString::copy assertion
2008-11-24 15:19:39 +0100 dr r264223 : #i95183# #158573# handle non-ascii characters in sheet names in OOXML import
2008-11-24 12:54:30 +0100 dr r264221 : #i94157# support ESC key to leave full-screen in page preview
2008-11-21 18:15:17 +0100 dr r264165 : #i90360# disable chart perspective if it is set to 0
2008-11-21 18:14:41 +0100 dr r264164 : #i90360# disable chart perspective if it is set to 0
2008-11-21 17:43:26 +0100 dr r264155 : #i96140# missing parenth
2008-11-21 17:36:35 +0100 dr r264154 : #i96438# first steps of note import
2008-11-20 15:15:03 +0100 dr r264059 : get rid of ContextWrapper
2008-11-18 11:39:52 +0100 dr r263755 : #i78476# moved to CWS dr67
2009-04-22 10:06:26 +00:00
|
|
|
xSet->setPropertyValue( rPropName, Any( false ) );
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2013-09-03 11:13:22 +03:00
|
|
|
// do not set properties at a group shape (this causes
|
|
|
|
// assertions from svx) ...
|
2012-06-01 17:19:58 +01:00
|
|
|
if( aServiceName != "com.sun.star.drawing.GroupShape" )
|
2012-09-26 12:22:17 +01:00
|
|
|
{
|
2013-12-02 13:49:51 +01:00
|
|
|
if (aServiceName == "com.sun.star.text.TextFrame")
|
|
|
|
{
|
2014-01-13 21:28:10 +02:00
|
|
|
if (mpCustomShapePropertiesPtr && mpCustomShapePropertiesPtr->getShapeTypeOverride())
|
2014-01-10 20:21:45 +05:30
|
|
|
{
|
|
|
|
uno::Reference<beans::XPropertySet> propertySet (mxShape, uno::UNO_QUERY);
|
|
|
|
uno::Sequence<beans::PropertyValue> aGrabBag;
|
|
|
|
propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag;
|
|
|
|
sal_Int32 length = aGrabBag.getLength();
|
|
|
|
aGrabBag.realloc( length+1);
|
|
|
|
aGrabBag[length].Name = "mso-orig-shape-type";
|
|
|
|
aGrabBag[length].Value = uno::makeAny(mpCustomShapePropertiesPtr->getShapePresetTypeName());
|
|
|
|
propertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag));
|
|
|
|
}
|
2014-04-18 13:12:53 +05:30
|
|
|
//If the text box has links then save the link information so that
|
|
|
|
//it can be accessed in DomainMapper_Impl.cxx while chaining the text frames.
|
|
|
|
if (this->isLinkedTxbx())
|
|
|
|
{
|
|
|
|
uno::Reference<beans::XPropertySet> propertySet (mxShape, uno::UNO_QUERY);
|
|
|
|
uno::Sequence<beans::PropertyValue> aGrabBag;
|
|
|
|
propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag;
|
|
|
|
sal_Int32 length = aGrabBag.getLength();
|
|
|
|
aGrabBag.realloc( length + 3 );
|
|
|
|
aGrabBag[length].Name = "TxbxHasLink";
|
|
|
|
aGrabBag[length].Value = uno::makeAny(this->isLinkedTxbx());
|
|
|
|
aGrabBag[length + 1 ].Name = "Txbx-Id";
|
|
|
|
aGrabBag[length + 1 ].Value = uno::makeAny(this->getLinkedTxbxAttributes().id);
|
|
|
|
aGrabBag[length + 2 ].Name = "Txbx-Seq";
|
|
|
|
aGrabBag[length + 2 ].Value = uno::makeAny(this->getLinkedTxbxAttributes().seq);
|
|
|
|
propertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag));
|
|
|
|
}
|
2014-01-10 20:21:45 +05:30
|
|
|
|
2013-12-06 10:14:45 +01:00
|
|
|
// TextFrames have BackColor, not FillColor
|
|
|
|
if (aShapeProps.hasProperty(PROP_FillColor))
|
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
aShapeProps.setProperty(PROP_BackColor, aShapeProps.getProperty(PROP_FillColor));
|
2013-12-06 10:14:45 +01:00
|
|
|
aShapeProps.erase(PROP_FillColor);
|
|
|
|
}
|
2013-12-02 13:49:51 +01:00
|
|
|
// TextFrames have BackColorTransparency, not FillTransparence
|
|
|
|
if (aShapeProps.hasProperty(PROP_FillTransparence))
|
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
aShapeProps.setProperty(PROP_BackColorTransparency, aShapeProps.getProperty(PROP_FillTransparence));
|
2013-12-02 13:49:51 +01:00
|
|
|
aShapeProps.erase(PROP_FillTransparence);
|
|
|
|
}
|
2014-01-02 16:31:26 +05:30
|
|
|
// TextFrames have BackGrahicURL, not FillBitmapURL
|
|
|
|
if (aShapeProps.hasProperty(PROP_FillBitmapURL))
|
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
aShapeProps.setProperty(PROP_BackGraphicURL, aShapeProps.getProperty(PROP_FillBitmapURL));
|
2014-01-02 16:31:26 +05:30
|
|
|
aShapeProps.erase(PROP_FillBitmapURL);
|
|
|
|
}
|
2014-03-06 21:21:43 +05:30
|
|
|
if (aShapeProps.hasProperty(PROP_FillBitmapName))
|
|
|
|
{
|
2014-03-06 21:38:44 +05:30
|
|
|
uno::Any aAny = aShapeProps.getProperty(PROP_FillBitmapName);
|
2014-03-06 21:21:43 +05:30
|
|
|
aShapeProps.setProperty(PROP_BackGraphicURL, rFilterBase.getModelObjectHelper().getFillBitmapUrl( aAny.get<OUString>() ));
|
|
|
|
// aShapeProps.erase(PROP_FillBitmapName); // Maybe, leave the name as well
|
|
|
|
}
|
2013-12-19 12:26:53 +01:00
|
|
|
// And no LineColor property; individual borders can have colors
|
|
|
|
if (aShapeProps.hasProperty(PROP_LineColor))
|
|
|
|
{
|
|
|
|
uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
|
|
|
|
static const sal_Int32 aBorders[] =
|
|
|
|
{
|
|
|
|
PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder
|
|
|
|
};
|
|
|
|
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i)
|
|
|
|
{
|
|
|
|
css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<css::table::BorderLine2>();
|
2014-03-04 09:34:37 +01:00
|
|
|
aBorderLine.Color = aShapeProps.getProperty(PROP_LineColor).get<sal_Int32>();
|
2013-12-20 11:14:29 +01:00
|
|
|
if (aLineProperties.moLineWidth.has())
|
|
|
|
aBorderLine.LineWidth = convertEmuToHmm(aLineProperties.moLineWidth.get());
|
2013-12-19 12:26:53 +01:00
|
|
|
aShapeProps.setProperty(aBorders[i], uno::makeAny(aBorderLine));
|
|
|
|
}
|
|
|
|
aShapeProps.erase(PROP_LineColor);
|
|
|
|
}
|
2014-01-10 19:15:10 +05:30
|
|
|
if(mnRotation)
|
|
|
|
{
|
|
|
|
uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
|
|
|
|
const OUString aGrabBagPropName = "FrameInteropGrabBag";
|
|
|
|
uno::Sequence<beans::PropertyValue> aGrabBag;
|
|
|
|
xPropertySet->getPropertyValue(aGrabBagPropName) >>= aGrabBag;
|
|
|
|
beans::PropertyValue aPair;
|
|
|
|
aPair.Name = "mso-rotation-angle";
|
|
|
|
aPair.Value = uno::makeAny(mnRotation);
|
|
|
|
if (aGrabBag.hasElements())
|
|
|
|
{
|
|
|
|
sal_Int32 nLength = aGrabBag.getLength();
|
|
|
|
aGrabBag.realloc(nLength + 1);
|
|
|
|
aGrabBag[nLength] = aPair;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aGrabBag.realloc(1);
|
|
|
|
aGrabBag[0] = aPair;
|
|
|
|
}
|
|
|
|
xPropertySet->setPropertyValue(aGrabBagPropName, uno::makeAny(aGrabBag));
|
|
|
|
}
|
2013-12-20 10:23:56 +01:00
|
|
|
// TextFrames have ShadowFormat, not individual shadow properties.
|
|
|
|
boost::optional<sal_Int32> oShadowDistance;
|
|
|
|
if (aShapeProps.hasProperty(PROP_ShadowXDistance))
|
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
oShadowDistance = aShapeProps.getProperty(PROP_ShadowXDistance).get<sal_Int32>();
|
2013-12-20 10:23:56 +01:00
|
|
|
aShapeProps.erase(PROP_ShadowXDistance);
|
|
|
|
}
|
|
|
|
if (aShapeProps.hasProperty(PROP_ShadowYDistance))
|
|
|
|
{
|
|
|
|
// There is a single 'dist' attribute, so no need to count the avg of x and y.
|
|
|
|
aShapeProps.erase(PROP_ShadowYDistance);
|
|
|
|
}
|
|
|
|
boost::optional<sal_Int32> oShadowColor;
|
|
|
|
if (aShapeProps.hasProperty(PROP_ShadowColor))
|
|
|
|
{
|
2014-03-04 09:34:37 +01:00
|
|
|
oShadowColor = aShapeProps.getProperty(PROP_ShadowColor).get<sal_Int32>();
|
2013-12-20 10:23:56 +01:00
|
|
|
aShapeProps.erase(PROP_ShadowColor);
|
|
|
|
}
|
|
|
|
if (aShapeProps.hasProperty(PROP_Shadow))
|
|
|
|
aShapeProps.erase(PROP_Shadow);
|
|
|
|
|
|
|
|
if (oShadowDistance || oShadowColor || aEffectProperties.maShadow.moShadowDir.has())
|
|
|
|
{
|
|
|
|
css::table::ShadowFormat aFormat;
|
|
|
|
if (oShadowColor)
|
|
|
|
aFormat.Color = *oShadowColor;
|
|
|
|
if (aEffectProperties.maShadow.moShadowDir.has())
|
|
|
|
{
|
|
|
|
css::table::ShadowLocation nLocation = css::table::ShadowLocation_NONE;
|
|
|
|
switch (aEffectProperties.maShadow.moShadowDir.get())
|
|
|
|
{
|
|
|
|
case 13500000:
|
|
|
|
nLocation = css::table::ShadowLocation_TOP_LEFT;
|
|
|
|
break;
|
|
|
|
case 18900000:
|
|
|
|
nLocation = css::table::ShadowLocation_TOP_RIGHT;
|
|
|
|
break;
|
|
|
|
case 8100000:
|
|
|
|
nLocation = css::table::ShadowLocation_BOTTOM_LEFT;
|
|
|
|
break;
|
|
|
|
case 2700000:
|
|
|
|
nLocation = css::table::ShadowLocation_BOTTOM_RIGHT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
aFormat.Location = nLocation;
|
|
|
|
}
|
|
|
|
aFormat.ShadowWidth = *oShadowDistance;
|
|
|
|
aShapeProps.setProperty(PROP_ShadowFormat, uno::makeAny(aFormat));
|
|
|
|
}
|
2013-12-02 13:49:51 +01:00
|
|
|
}
|
2014-05-06 17:00:40 +02:00
|
|
|
else if (mbTextBox)
|
|
|
|
{
|
|
|
|
//No such property yet
|
|
|
|
//aShapeProps.setProperty(PROP_TextBox, uno::makeAny(true));
|
|
|
|
}
|
2013-12-02 13:49:51 +01:00
|
|
|
|
2011-01-11 13:26:59 +01:00
|
|
|
PropertySet( xSet ).setProperties( aShapeProps );
|
2014-03-17 13:01:37 +05:30
|
|
|
if (mbLockedCanvas)
|
2013-06-20 20:56:26 +02:00
|
|
|
{
|
2014-03-17 13:01:37 +05:30
|
|
|
putPropertyToGrabBag( "LockedCanvas", Any( true ) );
|
|
|
|
if (aServiceName == "com.sun.star.drawing.LineShape")
|
|
|
|
{
|
|
|
|
// It seems the position and size for lines inside a locked canvas is absolute.
|
|
|
|
mxShape->setPosition(awt::Point(aShapeRectHmm.X, aShapeRectHmm.Y));
|
|
|
|
mxShape->setSize(awt::Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
|
|
|
|
}
|
2013-06-20 20:56:26 +02:00
|
|
|
}
|
2014-01-16 10:27:46 +01:00
|
|
|
|
2014-01-27 19:46:37 +01:00
|
|
|
// Store original fill and line colors of the shape and the theme color name to InteropGrabBag
|
2014-02-11 19:07:00 +01:00
|
|
|
Sequence< PropertyValue > aProperties( 6 ); //allocate the maximum possible number of slots
|
2014-01-27 19:46:37 +01:00
|
|
|
sal_Int32 nSize = 2;
|
2014-03-04 09:34:37 +01:00
|
|
|
PUT_PROP( aProperties, 0, "OriginalSolidFillClr", aShapeProps.getProperty(PROP_FillColor) );
|
|
|
|
PUT_PROP( aProperties, 1, "OriginalLnSolidFillClr", aShapeProps.getProperty(PROP_LineColor) );
|
2014-01-16 10:27:46 +01:00
|
|
|
OUString sColorFillScheme = aFillProperties.maFillColor.getSchemeName();
|
|
|
|
if( !aFillProperties.maFillColor.isPlaceHolder() && !sColorFillScheme.isEmpty() )
|
|
|
|
{
|
2014-02-11 19:07:00 +01:00
|
|
|
PUT_PROP( aProperties, nSize, "SpPrSolidFillSchemeClr", sColorFillScheme );
|
|
|
|
nSize++;
|
|
|
|
PUT_PROP( aProperties, nSize, "SpPrSolidFillSchemeClrTransformations",
|
|
|
|
aFillProperties.maFillColor.getTransformations() );
|
|
|
|
nSize++;
|
2014-01-27 19:46:37 +01:00
|
|
|
}
|
|
|
|
OUString sLnColorFillScheme = aLineProperties.maLineFill.maFillColor.getSchemeName();
|
|
|
|
if( !aLineProperties.maLineFill.maFillColor.isPlaceHolder() && !sLnColorFillScheme.isEmpty() )
|
|
|
|
{
|
2014-02-11 19:07:00 +01:00
|
|
|
PUT_PROP( aProperties, nSize, "SpPrLnSolidFillSchemeClr", sLnColorFillScheme );
|
|
|
|
nSize++;
|
|
|
|
PUT_PROP( aProperties, nSize, "SpPrLnSolidFillSchemeClrTransformations",
|
|
|
|
aLineProperties.maLineFill.maFillColor.getTransformations() );
|
|
|
|
nSize++;
|
2014-01-16 10:27:46 +01:00
|
|
|
}
|
2014-02-11 19:07:00 +01:00
|
|
|
aProperties.realloc( nSize ); //shrink the Sequence if we didn't use all the slots
|
2014-01-16 10:27:46 +01:00
|
|
|
putPropertiesToGrabBag( aProperties );
|
2014-01-31 14:02:12 +01:00
|
|
|
|
|
|
|
// Store original gradient fill of the shape to InteropGrabBag
|
|
|
|
// LibreOffice doesn't support all the kinds of gradient so we save its complete definition
|
|
|
|
if( aShapeProps.hasProperty( PROP_FillGradient ) )
|
|
|
|
{
|
|
|
|
Sequence< PropertyValue > aGradientStops( aFillProperties.maGradientProps.maGradientStops.size() );
|
|
|
|
::std::map< double, Color >::iterator aIt = aFillProperties.maGradientProps.maGradientStops.begin();
|
|
|
|
for( sal_uInt32 i = 0; i < aFillProperties.maGradientProps.maGradientStops.size(); ++i )
|
|
|
|
{ // for each stop in the gradient definition:
|
|
|
|
|
|
|
|
// save position
|
|
|
|
Sequence< PropertyValue > aGradientStop( 3 );
|
|
|
|
PUT_PROP( aGradientStop, 0, "Pos", aIt->first );
|
|
|
|
|
|
|
|
OUString sStopColorScheme = aIt->second.getSchemeName();
|
|
|
|
if( sStopColorScheme.isEmpty() )
|
|
|
|
{
|
|
|
|
// save RGB color
|
|
|
|
PUT_PROP( aGradientStop, 1, "RgbClr", aIt->second.getColor( rGraphicHelper, nFillPhClr ) );
|
|
|
|
// in the case of a RGB color, transformations are already applied to
|
|
|
|
// the color with the exception of alpha transformations. We only need
|
|
|
|
// to keep the transparency value to calculate the alpha value later.
|
|
|
|
if( aIt->second.hasTransparency() )
|
|
|
|
{
|
|
|
|
PUT_PROP( aGradientStop, 2, "Transparency", aIt->second.getTransparency() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// save color with scheme name
|
|
|
|
PUT_PROP( aGradientStop, 1, "SchemeClr", sStopColorScheme );
|
|
|
|
// save all color transformations
|
|
|
|
PUT_PROP( aGradientStop, 2, "Transformations", aIt->second.getTransformations() );
|
|
|
|
}
|
|
|
|
|
|
|
|
PUT_PROP( aGradientStops, i, OUString::number( i ), aGradientStop );
|
|
|
|
++aIt;
|
|
|
|
}
|
2014-02-20 11:48:35 +01:00
|
|
|
// If getFillProperties.moFillType is unused that means gradient is defined by a theme
|
|
|
|
// which is already saved into StyleFillRef property, so no need to save the explicit values too
|
|
|
|
if( getFillProperties().moFillType.has() )
|
|
|
|
putPropertyToGrabBag( "GradFillDefinition", Any( aGradientStops ) );
|
2014-03-04 09:34:37 +01:00
|
|
|
putPropertyToGrabBag( "OriginalGradFill", aShapeProps.getProperty(PROP_FillGradient) );
|
2014-01-31 14:02:12 +01:00
|
|
|
}
|
2014-04-22 20:30:24 +02:00
|
|
|
|
|
|
|
// store unsupported effect attributes in the grab bag
|
2014-05-16 09:56:58 +02:00
|
|
|
if( aEffectProperties.maEffects.size() > 0 )
|
2014-04-22 20:30:24 +02:00
|
|
|
{
|
2014-05-16 09:56:58 +02:00
|
|
|
Sequence< PropertyValue > aEffects( aEffectProperties.maEffects.size() );
|
|
|
|
sal_uInt32 i = 0;
|
|
|
|
for( std::vector< Effect* >::iterator it = aEffectProperties.maEffects.begin();
|
|
|
|
it != aEffectProperties.maEffects.end(); ++it )
|
2014-04-22 20:30:24 +02:00
|
|
|
{
|
2014-05-16 09:56:58 +02:00
|
|
|
PropertyValue aEffect = (*it)->getEffect();
|
|
|
|
if( !aEffect.Name.isEmpty() )
|
|
|
|
{
|
|
|
|
Sequence< PropertyValue > aEffectsGrabBag( 3 );
|
|
|
|
PUT_PROP( aEffectsGrabBag, 0, "Attribs", aEffect.Value );
|
2014-04-22 20:30:24 +02:00
|
|
|
|
2014-05-16 09:56:58 +02:00
|
|
|
Color& aColor( (*it)->moColor );
|
|
|
|
OUString sColorScheme = aColor.getSchemeName();
|
|
|
|
if( sColorScheme.isEmpty() )
|
|
|
|
{
|
|
|
|
// RGB color and transparency value
|
|
|
|
PUT_PROP( aEffectsGrabBag, 1, "RgbClr",
|
|
|
|
aColor.getColor( rGraphicHelper, nFillPhClr ) );
|
|
|
|
PUT_PROP( aEffectsGrabBag, 2, "RgbClrTransparency",
|
|
|
|
aColor.getTransparency() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// scheme color with name and transformations
|
|
|
|
PUT_PROP( aEffectsGrabBag, 1, "SchemeClr", sColorScheme );
|
|
|
|
PUT_PROP( aEffectsGrabBag, 2, "SchemeClrTransformations",
|
|
|
|
aColor.getTransformations() );
|
|
|
|
}
|
|
|
|
PUT_PROP( aEffects, i, aEffect.Name, aEffectsGrabBag );
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
putPropertyToGrabBag( "EffectProperties", Any( aEffects ) );
|
2014-04-22 20:30:24 +02:00
|
|
|
}
|
2014-05-05 17:24:59 +02:00
|
|
|
|
|
|
|
// add 3D effects if any
|
|
|
|
Sequence< PropertyValue > aCamera3DEffects = get3DProperties().getCameraAttributes();
|
2014-05-06 16:40:27 +02:00
|
|
|
Sequence< PropertyValue > aLightRig3DEffects = get3DProperties().getLightRigAttributes();
|
2014-05-12 19:13:06 +02:00
|
|
|
Sequence< PropertyValue > aShape3DEffects = get3DProperties().getShape3DAttributes( rGraphicHelper, nFillPhClr );
|
2014-05-14 19:51:11 +02:00
|
|
|
if( aCamera3DEffects.getLength() > 0 || aLightRig3DEffects.getLength() > 0 || aShape3DEffects.getLength() > 0 )
|
2014-05-06 16:40:27 +02:00
|
|
|
{
|
2014-05-08 14:25:10 +02:00
|
|
|
Sequence< PropertyValue > a3DEffectsGrabBag( 3 );
|
2014-05-06 16:40:27 +02:00
|
|
|
PUT_PROP( a3DEffectsGrabBag, 0, "Camera", Any( aCamera3DEffects ) );
|
|
|
|
PUT_PROP( a3DEffectsGrabBag, 1, "LightRig", Any( aLightRig3DEffects ) );
|
2014-05-08 14:25:10 +02:00
|
|
|
PUT_PROP( a3DEffectsGrabBag, 2, "Shape3D", Any( aShape3DEffects ) );
|
2014-05-06 16:40:27 +02:00
|
|
|
putPropertyToGrabBag( "3DEffectProperties", Any( a3DEffectsGrabBag ) );
|
|
|
|
}
|
2012-09-26 12:22:17 +01:00
|
|
|
}
|
2008-01-17 07:06:10 +00:00
|
|
|
|
2013-11-21 11:44:22 +01:00
|
|
|
// These can have a custom geometry, so position should be set here,
|
|
|
|
// after creation but before custom shape handling, using the position
|
|
|
|
// we got from the caller.
|
2013-11-26 16:24:13 +01:00
|
|
|
if (mbWps && aServiceName != "com.sun.star.text.TextFrame")
|
2013-11-21 11:44:22 +01:00
|
|
|
mxShape->setPosition(maPosition);
|
|
|
|
|
2011-12-08 16:47:56 +05:30
|
|
|
if( bIsCustomShape )
|
|
|
|
{
|
|
|
|
if ( mbFlipH )
|
2014-04-01 13:41:19 +02:00
|
|
|
mpCustomShapePropertiesPtr->setMirroredX( true );
|
2011-12-08 16:47:56 +05:30
|
|
|
if ( mbFlipV )
|
2014-04-01 13:41:19 +02:00
|
|
|
mpCustomShapePropertiesPtr->setMirroredY( true );
|
2012-02-14 19:49:31 +05:30
|
|
|
if( getTextBody() )
|
2011-12-13 12:07:20 +08:00
|
|
|
{
|
2012-02-14 19:49:31 +05:30
|
|
|
sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) );
|
2012-10-10 17:23:52 +02:00
|
|
|
mpCustomShapePropertiesPtr->setTextRotateAngle( nTextRotateAngle / 60000 );
|
2011-12-13 12:07:20 +08:00
|
|
|
}
|
|
|
|
|
2013-08-15 17:08:11 +03:00
|
|
|
SAL_INFO("oox.cscode", "==cscode== shape name: '" << msName << "'");
|
2014-04-16 18:29:46 +02:00
|
|
|
SAL_INFO("oox.csdata", "==csdata== shape name: '" << msName << "'");
|
2013-10-10 12:19:38 +05:30
|
|
|
mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape, maSize );
|
2011-12-08 16:47:56 +05:30
|
|
|
}
|
2012-02-14 19:49:31 +05:30
|
|
|
else if( getTextBody() )
|
|
|
|
getTextBody()->getTextProperties().pushVertSimulation();
|
2011-12-08 16:47:56 +05:30
|
|
|
|
2014-04-14 17:27:35 +02:00
|
|
|
if ( !bUseRotationTransform && mnRotation != 0 )
|
|
|
|
{
|
|
|
|
// use the same logic for rotation from VML exporter (SimpleShape::implConvertAndInsert at vmlshape.cxx)
|
|
|
|
PropertySet aPropertySet( mxShape );
|
|
|
|
aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( NormAngle360( mnRotation / -600 ) ) ) );
|
|
|
|
aPropertySet.setAnyProperty( PROP_HoriOrientPosition, makeAny( maPosition.X ) );
|
|
|
|
aPropertySet.setAnyProperty( PROP_VertOrientPosition, makeAny( maPosition.Y ) );
|
|
|
|
}
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
// in some cases, we don't have any text body.
|
2012-05-23 17:05:36 +02:00
|
|
|
if( getTextBody() && ( !bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty() ) )
|
2008-01-17 07:06:10 +00:00
|
|
|
{
|
2008-06-20 05:54:51 +00:00
|
|
|
Reference < XText > xText( mxShape, UNO_QUERY );
|
2008-01-17 07:06:10 +00:00
|
|
|
if ( xText.is() ) // not every shape is supporting an XText interface (e.g. GroupShape)
|
|
|
|
{
|
2008-07-22 12:40:31 +00:00
|
|
|
TextCharacterProperties aCharStyleProperties;
|
|
|
|
if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) )
|
|
|
|
{
|
2009-07-13 08:56:32 +00:00
|
|
|
if( pTheme )
|
|
|
|
if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) )
|
2008-07-22 12:40:31 +00:00
|
|
|
aCharStyleProperties.assignUsed( *pCharProps );
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "use font color");
|
2008-07-22 12:40:31 +00:00
|
|
|
aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr );
|
|
|
|
}
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
Reference < XTextCursor > xAt = xText->createTextCursor();
|
2008-07-22 12:40:31 +00:00
|
|
|
getTextBody()->insertAt( rFilterBase, xText, xAt, aCharStyleProperties, mpMasterTextListStyle );
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-07-22 12:40:31 +00:00
|
|
|
|
2010-08-26 18:37:44 +02:00
|
|
|
if( mxShape.is() )
|
|
|
|
finalizeXShape( rFilterBase, rxShapes );
|
2008-04-18 13:14:41 +00:00
|
|
|
|
2008-06-20 05:54:51 +00:00
|
|
|
return mxShape;
|
2008-01-17 07:06:10 +00:00
|
|
|
}
|
|
|
|
|
2013-09-26 20:35:48 +03:00
|
|
|
void Shape::keepDiagramCompatibilityInfo( XmlFilterBase& rFilterBase )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if( !maDiagramDoms.hasElements() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Reference < XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
|
|
|
|
Reference < XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
|
|
|
|
if ( !xSetInfo.is() )
|
|
|
|
return;
|
|
|
|
|
2013-11-15 11:05:19 +02:00
|
|
|
const OUString aGrabBagPropName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
|
2013-09-26 20:35:48 +03:00
|
|
|
if( !xSetInfo->hasPropertyByName( aGrabBagPropName ) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Sequence < PropertyValue > aGrabBag;
|
|
|
|
xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
|
|
|
|
|
|
|
|
// We keep the previous items, if present
|
|
|
|
if ( aGrabBag.hasElements() )
|
|
|
|
{
|
|
|
|
sal_Int32 length = aGrabBag.getLength();
|
|
|
|
aGrabBag.realloc( length+maDiagramDoms.getLength() );
|
|
|
|
|
|
|
|
for( sal_Int32 i = 0; i < maDiagramDoms.getLength(); ++i )
|
|
|
|
aGrabBag[length+i] = maDiagramDoms[i];
|
|
|
|
|
|
|
|
xSet->setPropertyValue( aGrabBagPropName, Any( aGrabBag ) );
|
|
|
|
} else
|
|
|
|
xSet->setPropertyValue( aGrabBagPropName, Any( maDiagramDoms ) );
|
|
|
|
|
|
|
|
xSet->setPropertyValue( OUString( "MoveProtect" ), Any( sal_True ) );
|
|
|
|
xSet->setPropertyValue( OUString( "SizeProtect" ), Any( sal_True ) );
|
|
|
|
|
|
|
|
// Replace existing shapes with a new Graphic Object rendered
|
|
|
|
// from them
|
|
|
|
Reference < XShape > xShape( renderDiagramToGraphic( rFilterBase ) );
|
|
|
|
Reference < XShapes > xShapes( mxShape, UNO_QUERY_THROW );
|
|
|
|
while( xShapes->hasElements() )
|
|
|
|
xShapes->remove( Reference < XShape > ( xShapes->getByIndex( 0 ), UNO_QUERY_THROW ) );
|
|
|
|
xShapes->add( xShape );
|
|
|
|
}
|
|
|
|
catch( const Exception& e )
|
|
|
|
{
|
|
|
|
SAL_WARN( "oox.drawingml", OSL_THIS_FUNC << "Exception: " << e.Message );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
|
|
|
|
{
|
|
|
|
Reference< XShape > xShape;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if( !maDiagramDoms.hasElements() )
|
|
|
|
return xShape;
|
|
|
|
|
|
|
|
// Stream in which to place the rendered shape
|
|
|
|
SvMemoryStream mpTempStream;
|
|
|
|
Reference < io::XStream > xStream( new utl::OStreamWrapper( mpTempStream ) );
|
|
|
|
Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
|
|
|
|
|
|
|
|
// Rendering format
|
2014-05-16 16:43:25 +03:00
|
|
|
OUString sFormat( "SVM" );
|
2013-09-26 20:35:48 +03:00
|
|
|
|
|
|
|
// Size of the rendering
|
|
|
|
awt::Size aActualSize = mxShape->getSize();
|
|
|
|
Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
|
|
|
|
double fPixelsPer100thmm = static_cast < double > ( aResolution.Width() ) / 100000.0;
|
|
|
|
awt::Size aSize = awt::Size( static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ),
|
|
|
|
static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) );
|
|
|
|
|
2014-05-16 16:43:25 +03:00
|
|
|
Sequence< PropertyValue > aFilterData( 4 );
|
|
|
|
aFilterData[ 0 ].Name = "PixelWidth";
|
|
|
|
aFilterData[ 0 ].Value <<= aSize.Width;
|
|
|
|
aFilterData[ 1 ].Name = "PixelHeight";
|
|
|
|
aFilterData[ 1 ].Value <<= aSize.Height;
|
|
|
|
aFilterData[ 2 ].Name = "LogicalWidth";
|
|
|
|
aFilterData[ 2 ].Value <<= aActualSize.Width;
|
|
|
|
aFilterData[ 3 ].Name = "LogicalHeight";
|
|
|
|
aFilterData[ 3 ].Value <<= aActualSize.Height;
|
2013-09-26 20:35:48 +03:00
|
|
|
|
|
|
|
Sequence < PropertyValue > aDescriptor( 3 );
|
2013-11-15 11:05:19 +02:00
|
|
|
aDescriptor[ 0 ].Name = "OutputStream";
|
2013-09-26 20:35:48 +03:00
|
|
|
aDescriptor[ 0 ].Value <<= xOutputStream;
|
2013-11-15 11:05:19 +02:00
|
|
|
aDescriptor[ 1 ].Name = "FilterName";
|
2013-09-26 20:35:48 +03:00
|
|
|
aDescriptor[ 1 ].Value <<= sFormat;
|
2013-11-15 11:05:19 +02:00
|
|
|
aDescriptor[ 2 ].Name = "FilterData";
|
2013-09-26 20:35:48 +03:00
|
|
|
aDescriptor[ 2 ].Value <<= aFilterData;
|
|
|
|
|
|
|
|
Reference < lang::XComponent > xSourceDoc( mxShape, UNO_QUERY_THROW );
|
|
|
|
Reference < XGraphicExportFilter > xGraphicExporter = GraphicExportFilter::create( rFilterBase.getComponentContext() );
|
|
|
|
xGraphicExporter->setSourceDocument( xSourceDoc );
|
|
|
|
xGraphicExporter->filter( aDescriptor );
|
|
|
|
|
|
|
|
mpTempStream.Seek( STREAM_SEEK_TO_BEGIN );
|
|
|
|
|
|
|
|
Graphic aGraphic;
|
2014-02-21 12:53:51 +01:00
|
|
|
GraphicFilter aFilter( false );
|
2013-10-16 12:36:11 +02:00
|
|
|
if ( aFilter.ImportGraphic( aGraphic, "", mpTempStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, static_cast < Sequence < PropertyValue >* > ( NULL ), NULL ) != GRFILTER_OK )
|
2013-09-26 20:35:48 +03:00
|
|
|
{
|
|
|
|
SAL_WARN( "oox.drawingml", OSL_THIS_FUNC
|
|
|
|
<< "Unable to import rendered stream into graphic object" );
|
|
|
|
return xShape;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference < graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
|
|
|
|
Reference < lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
|
|
|
|
xShape = Reference < XShape > ( xServiceFact->createInstance( OUString( "com.sun.star.drawing.GraphicObjectShape" ) ), UNO_QUERY_THROW );
|
|
|
|
Reference < XPropertySet > xPropSet( xShape, UNO_QUERY_THROW );
|
|
|
|
xPropSet->setPropertyValue( OUString( "Graphic" ), Any( xGraphic ) );
|
|
|
|
xPropSet->setPropertyValue( OUString( "MoveProtect" ), Any( sal_True ) );
|
|
|
|
xPropSet->setPropertyValue( OUString( "SizeProtect" ), Any( sal_True ) );
|
|
|
|
xPropSet->setPropertyValue( OUString( "Name" ), Any( OUString( "RenderedShapes" ) ) );
|
|
|
|
}
|
|
|
|
catch( const Exception& e )
|
|
|
|
{
|
|
|
|
SAL_WARN( "oox.drawingml", OSL_THIS_FUNC << "Exception: " << e.Message );
|
|
|
|
}
|
|
|
|
|
|
|
|
return xShape;
|
|
|
|
}
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
void Shape::setTextBody(const TextBodyPtr & pTextBody)
|
|
|
|
{
|
|
|
|
mpTextBody = pTextBody;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TextBodyPtr Shape::getTextBody()
|
|
|
|
{
|
|
|
|
return mpTextBody;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle )
|
|
|
|
{
|
2013-08-20 15:50:01 +03:00
|
|
|
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "set master text list style to shape id: " << msId);
|
2011-08-17 10:39:00 +02:00
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
mpMasterTextListStyle = pMasterTextListStyle;
|
|
|
|
}
|
|
|
|
|
2012-12-13 19:02:26 +01:00
|
|
|
OUString Shape::finalizeServiceName( XmlFilterBase& rFilter, const OUString& rServiceName, const awt::Rectangle& rShapeRect )
|
2010-08-26 18:37:44 +02:00
|
|
|
{
|
|
|
|
OUString aServiceName = rServiceName;
|
|
|
|
switch( meFrameType )
|
|
|
|
{
|
|
|
|
case FRAMETYPE_OLEOBJECT:
|
|
|
|
{
|
2012-12-13 19:02:26 +01:00
|
|
|
awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height );
|
2010-08-26 18:37:44 +02:00
|
|
|
if( rFilter.getOleObjectHelper().importOleObject( maShapeProperties, *mxOleObjectInfo, aOleSize ) )
|
2013-01-04 15:39:44 +01:00
|
|
|
aServiceName = "com.sun.star.drawing.OLE2Shape";
|
2010-08-26 18:37:44 +02:00
|
|
|
|
|
|
|
// get the path to the representation graphic
|
|
|
|
OUString aGraphicPath;
|
2012-01-01 12:55:53 -02:00
|
|
|
if( !mxOleObjectInfo->maShapeId.isEmpty() )
|
2010-08-26 18:37:44 +02:00
|
|
|
if( ::oox::vml::Drawing* pVmlDrawing = rFilter.getVmlDrawing() )
|
|
|
|
if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) )
|
|
|
|
aGraphicPath = pVmlShape->getGraphicPath();
|
|
|
|
|
|
|
|
// import and store the graphic
|
2012-01-01 12:55:53 -02:00
|
|
|
if( !aGraphicPath.isEmpty() )
|
2010-08-26 18:37:44 +02:00
|
|
|
{
|
2014-04-24 18:39:27 +02:00
|
|
|
// Transfer shape's width and heightto graphicsfilter (can be used by WMF/EMF)
|
|
|
|
WMF_EXTERNALHEADER aExtHeader;
|
|
|
|
aExtHeader.mapMode = 8; // MM_ANISOTROPIC
|
|
|
|
aExtHeader.xExt = rShapeRect.Width;
|
|
|
|
aExtHeader.yExt = rShapeRect.Height;
|
|
|
|
|
|
|
|
Reference< graphic::XGraphic > xGraphic = rFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath, &aExtHeader );
|
2010-08-26 18:37:44 +02:00
|
|
|
if( xGraphic.is() )
|
2014-03-04 09:34:37 +01:00
|
|
|
maShapeProperties.setProperty(PROP_Graphic, xGraphic);
|
2010-08-26 18:37:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:;
|
|
|
|
}
|
|
|
|
return aServiceName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
|
|
|
|
{
|
|
|
|
switch( meFrameType )
|
|
|
|
{
|
|
|
|
case FRAMETYPE_CHART:
|
|
|
|
{
|
2012-01-01 12:55:53 -02:00
|
|
|
OSL_ENSURE( !mxChartShapeInfo->maFragmentPath.isEmpty(), "Shape::finalizeXShape - missing chart fragment" );
|
|
|
|
if( mxShape.is() && !mxChartShapeInfo->maFragmentPath.isEmpty() ) try
|
2010-08-26 18:37:44 +02:00
|
|
|
{
|
|
|
|
// set the chart2 OLE class ID at the OLE shape
|
|
|
|
PropertySet aShapeProp( mxShape );
|
2013-01-04 15:39:44 +01:00
|
|
|
aShapeProp.setProperty( PROP_CLSID, OUString( "12dcae26-281f-416f-a234-c3086127382e" ) );
|
2010-08-26 18:37:44 +02:00
|
|
|
|
|
|
|
// get the XModel interface of the embedded object from the OLE shape
|
|
|
|
Reference< frame::XModel > xDocModel;
|
|
|
|
aShapeProp.getProperty( xDocModel, PROP_Model );
|
|
|
|
Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
// load the chart data from the XML fragment
|
|
|
|
chart::ChartSpaceModel aModel;
|
|
|
|
rFilter.importFragment( new chart::ChartSpaceFragment( rFilter, mxChartShapeInfo->maFragmentPath, aModel ) );
|
|
|
|
|
|
|
|
// convert imported chart model to chart document
|
|
|
|
Reference< drawing::XShapes > xExternalPage;
|
|
|
|
if( !mxChartShapeInfo->mbEmbedShapes )
|
|
|
|
xExternalPage = rxShapes;
|
2011-08-12 15:53:12 +02:00
|
|
|
if( rFilter.getChartConverter() )
|
2013-07-09 13:31:16 +05:30
|
|
|
{
|
2011-08-12 15:53:12 +02:00
|
|
|
rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() );
|
2013-07-09 13:31:16 +05:30
|
|
|
if( !xChartDoc->hasInternalDataProvider() )
|
|
|
|
{
|
|
|
|
Reference< chart2::data::XDataReceiver > xDataRec( xChartDoc, UNO_QUERY );
|
|
|
|
Reference< chart2::data::XDataSource > xData( xDataRec->getUsedData(), UNO_QUERY );
|
2013-07-09 14:00:21 +05:30
|
|
|
if( xData->getDataSequences().getLength() <= 0 || xData->getDataSequences()[0]->getValues()->getData().getLength() <= 0 )
|
2013-07-09 13:31:16 +05:30
|
|
|
{
|
|
|
|
rFilter.useInternalChartDataTable( true );
|
|
|
|
rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() );
|
|
|
|
rFilter.useInternalChartDataTable( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-08-26 18:37:44 +02:00
|
|
|
}
|
|
|
|
catch( Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-28 13:51:16 +01:00
|
|
|
void Shape::putPropertyToGrabBag( const OUString& sPropertyName, const Any& aPropertyValue )
|
|
|
|
{
|
|
|
|
PropertyValue pNewProperty;
|
|
|
|
pNewProperty.Name = sPropertyName;
|
|
|
|
pNewProperty.Value = aPropertyValue;
|
|
|
|
putPropertyToGrabBag( pNewProperty );
|
|
|
|
}
|
|
|
|
|
2014-01-14 18:43:06 +01:00
|
|
|
void Shape::putPropertyToGrabBag( const PropertyValue& pProperty )
|
|
|
|
{
|
|
|
|
Reference< XPropertySet > xSet( mxShape, UNO_QUERY );
|
|
|
|
Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
|
|
|
|
const OUString& aGrabBagPropName = OUString( UNO_NAME_MISC_OBJ_INTEROPGRABBAG );
|
|
|
|
if( mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName ) )
|
|
|
|
{
|
|
|
|
Sequence< PropertyValue > aGrabBag;
|
|
|
|
xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
|
|
|
|
|
|
|
|
sal_Int32 length = aGrabBag.getLength();
|
|
|
|
aGrabBag.realloc( length + 1 );
|
|
|
|
aGrabBag[length] = pProperty;
|
|
|
|
|
|
|
|
xSet->setPropertyValue( aGrabBagPropName, Any( aGrabBag ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-16 10:27:46 +01:00
|
|
|
void Shape::putPropertiesToGrabBag( const Sequence< PropertyValue >& aProperties )
|
|
|
|
{
|
|
|
|
Reference< XPropertySet > xSet( mxShape, UNO_QUERY );
|
|
|
|
Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
|
|
|
|
const OUString& aGrabBagPropName = OUString( UNO_NAME_MISC_OBJ_INTEROPGRABBAG );
|
|
|
|
if( mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName ) )
|
|
|
|
{
|
|
|
|
// get existing grab bag
|
|
|
|
Sequence< PropertyValue > aGrabBag;
|
|
|
|
xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
|
|
|
|
sal_Int32 length = aGrabBag.getLength();
|
|
|
|
|
|
|
|
// update grab bag size to contain the new items
|
|
|
|
aGrabBag.realloc( length + aProperties.getLength() );
|
|
|
|
|
|
|
|
// put the new items
|
|
|
|
for( sal_Int32 i=0; i < aProperties.getLength(); ++i )
|
|
|
|
{
|
|
|
|
aGrabBag[length + i].Name = aProperties[i].Name;
|
|
|
|
aGrabBag[length + i].Value = aProperties[i].Value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// put it back to the shape
|
|
|
|
xSet->setPropertyValue( aGrabBagPropName, Any( aGrabBag ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-17 08:58:59 +02:00
|
|
|
uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType )
|
2014-02-25 13:13:11 +05:30
|
|
|
{
|
|
|
|
uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp;
|
|
|
|
sal_Int32 counter = 0;
|
|
|
|
|
|
|
|
core::RelationsRef xRels = rFilter.importRelations( sFragment );
|
|
|
|
if ( xRels )
|
|
|
|
{
|
2014-03-06 11:22:47 +01:00
|
|
|
core::RelationsRef xImageRels = xRels->getRelationsFromTypeFromOfficeDoc( sType );
|
2014-02-25 13:13:11 +05:30
|
|
|
if ( xImageRels )
|
|
|
|
{
|
|
|
|
xRelListTemp.realloc( xImageRels->size() );
|
|
|
|
for( ::std::map< OUString, core::Relation >::const_iterator aIt = xImageRels->begin(), aEnd = xImageRels->end(); aIt != aEnd; ++aIt )
|
|
|
|
{
|
|
|
|
uno::Sequence< uno::Any > diagramRelTuple (3);
|
|
|
|
// [0] => RID, [1] => InputStream [2] => extension
|
|
|
|
OUString sRelId = aIt->second.maId;
|
|
|
|
|
|
|
|
diagramRelTuple[0] = uno::makeAny ( sRelId );
|
|
|
|
OUString sTarget = xImageRels->getFragmentPathFromRelId( sRelId );
|
|
|
|
|
|
|
|
uno::Reference< io::XInputStream > xImageInputStrm( rFilter.openInputStream( sTarget ), uno::UNO_SET_THROW );
|
|
|
|
StreamDataSequence dataSeq;
|
|
|
|
if ( rFilter.importBinaryData( dataSeq, sTarget ) )
|
|
|
|
{
|
|
|
|
diagramRelTuple[1] = uno::makeAny( dataSeq );
|
|
|
|
}
|
|
|
|
|
|
|
|
diagramRelTuple[2] = uno::makeAny( sTarget.copy( sTarget.lastIndexOf(".") ) );
|
|
|
|
|
|
|
|
xRelListTemp[counter] = diagramRelTuple;
|
|
|
|
++counter;
|
|
|
|
}
|
|
|
|
xRelListTemp.realloc(counter);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return xRelListTemp;
|
|
|
|
}
|
|
|
|
|
2008-01-17 07:06:10 +00:00
|
|
|
} }
|
2010-10-12 15:56:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|