summaryrefslogtreecommitdiff
path: root/xmloff/source/text/XMLTextShapeStyleContext.cxx
blob: 5ce5fafe4f4fadb5f521ac4bcbd6b23181b69419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * 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 .
 */

#include <tools/debug.hxx>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlimp.hxx>
#include <xmloff/XMLEventsImportContext.hxx>
#include <XMLShapePropertySetContext.hxx>
#include <XMLTextColumnsContext.hxx>
#include <XMLBackgroundImageContext.hxx>
#include <xmloff/XMLComplexColorContext.hxx>
#include <xmloff/txtprmap.hxx>
#include <xmloff/xmltypes.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/xmlimppr.hxx>

#include <xmloff/XMLTextShapeStyleContext.hxx>

using namespace ::com::sun::star::document;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::style;
using namespace ::com::sun::star::beans;
using namespace ::xmloff::token;

namespace {

class XMLTextShapePropertySetContext_Impl : public XMLShapePropertySetContext
{
public:
    XMLTextShapePropertySetContext_Impl( SvXMLImport& rImport, sal_Int32 nElement,
        const Reference< XFastAttributeList >& xAttrList,
        sal_uInt32 nFamily,
        ::std::vector< XMLPropertyState > &rProps,
        const rtl::Reference < SvXMLImportPropertyMapper > &rMap );

    using SvXMLPropertySetContext::createFastChildContext;
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext(
        sal_Int32 nElement,
        const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
        ::std::vector< XMLPropertyState > &rProperties,
        const XMLPropertyState& rProp ) override;
};

}

XMLTextShapePropertySetContext_Impl::XMLTextShapePropertySetContext_Impl(
                 SvXMLImport& rImport, sal_Int32 nElement,
                 const Reference< XFastAttributeList > & xAttrList,
                 sal_uInt32 nFamily,
                 ::std::vector< XMLPropertyState > &rProps,
                 const rtl::Reference < SvXMLImportPropertyMapper > &rMap ) :
    XMLShapePropertySetContext( rImport, nElement, xAttrList, nFamily,
                                rProps, rMap )
{
}

css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextShapePropertySetContext_Impl::createFastChildContext(
    sal_Int32 nElement,
    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
    ::std::vector< XMLPropertyState > &rProperties,
    const XMLPropertyState& rProp )
{
    switch( mxMapper->getPropertySetMapper()
                    ->GetEntryContextId( rProp.mnIndex ) )
    {
    case CTF_TEXTCOLUMNS:
        return new XMLTextColumnsContext( GetImport(), nElement,
                                                   xAttrList, rProp,
                                                   rProperties );
        break;

    case CTF_COMPLEX_COLOR:
        return new XMLPropertyComplexColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);

    case CTF_BACKGROUND_URL:
        DBG_ASSERT( rProp.mnIndex >= 3 &&
                    CTF_BACKGROUND_TRANSPARENCY ==
                        mxMapper->getPropertySetMapper()
                        ->GetEntryContextId( rProp.mnIndex-3 ) &&
                    CTF_BACKGROUND_POS  == mxMapper->getPropertySetMapper()
                        ->GetEntryContextId( rProp.mnIndex-2 ) &&
                    CTF_BACKGROUND_FILTER  == mxMapper->getPropertySetMapper()
                        ->GetEntryContextId( rProp.mnIndex-1 ),
                    "invalid property map!");
        return
            new XMLBackgroundImageContext( GetImport(), nElement,
                                           xAttrList,
                                           rProp,
                                           rProp.mnIndex-2,
                                           rProp.mnIndex-1,
                                           rProp.mnIndex-3,
                                           -1,
                                           rProperties );
        break;
    }

    return XMLShapePropertySetContext::createFastChildContext(
                        nElement, xAttrList, rProperties, rProp );
}

void XMLTextShapeStyleContext::SetAttribute( sal_Int32 nElement,
                                        const OUString& rValue )
{
    if( nElement == XML_ELEMENT(STYLE, XML_AUTO_UPDATE) )
    {
          if( IsXMLToken( rValue, XML_TRUE ) )
            m_bAutoUpdate = true;
    }
    else
    {
        XMLShapeStyleContext::SetAttribute( nElement, rValue );
    }
}


constexpr OUString gsIsAutoUpdate( u"IsAutoUpdate"_ustr );

XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport,
        SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) :
    XMLShapeStyleContext( rImport, rStyles, nFamily ),
    m_bAutoUpdate( false )
{
}

XMLTextShapeStyleContext::~XMLTextShapeStyleContext()
{
}

css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextShapeStyleContext::createFastChildContext(
    sal_Int32 nElement,
    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
{
    if( IsTokenInNamespace(nElement, XML_NAMESPACE_STYLE) ||
        IsTokenInNamespace(nElement, XML_NAMESPACE_LO_EXT) )
    {
        sal_Int32 nLocalName = nElement & TOKEN_MASK;
        sal_uInt32 nFamily = 0;
        if( nLocalName == XML_TEXT_PROPERTIES )
            nFamily = XML_TYPE_PROP_TEXT;
        else if( nLocalName == XML_PARAGRAPH_PROPERTIES )
            nFamily = XML_TYPE_PROP_PARAGRAPH;
        else if( nLocalName == XML_GRAPHIC_PROPERTIES )
            nFamily = XML_TYPE_PROP_GRAPHIC;
        if( nFamily )
        {
            rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
                GetStyles()->GetImportPropertyMapper( GetFamily() );
            if( xImpPrMap.is() )
            {
                return new XMLTextShapePropertySetContext_Impl(
                        GetImport(), nElement, xAttrList, nFamily,
                        GetProperties(), xImpPrMap );
            }
        }
    }
    else if ( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) )
    {
        // create and remember events import context
        // (for delayed processing of events)
        m_xEventContext = new XMLEventsImportContext( GetImport() );
        return m_xEventContext;
    }

    return XMLShapeStyleContext::createFastChildContext( nElement, xAttrList );
}

void XMLTextShapeStyleContext::CreateAndInsert( bool bOverwrite )
{
    XMLShapeStyleContext::CreateAndInsert( bOverwrite );
    Reference < XStyle > xStyle = GetStyle();
    if( !xStyle.is() || !(bOverwrite || IsNew()) )
        return;

    Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
    Reference< XPropertySetInfo > xPropSetInfo =
                xPropSet->getPropertySetInfo();
    if( xPropSetInfo->hasPropertyByName( gsIsAutoUpdate ) )
    {
        bool bTmp = m_bAutoUpdate;
        xPropSet->setPropertyValue( gsIsAutoUpdate, Any(bTmp) );
    }

    // tell the style about it's events (if applicable)
    if( m_xEventContext.is() )
    {
        // set event supplier and release reference to context
        Reference<XEventsSupplier> xEventsSupplier(xStyle, UNO_QUERY);
        m_xEventContext->SetEvents(xEventsSupplier);
        m_xEventContext = nullptr;
    }
}

void XMLTextShapeStyleContext::Finish( bool bOverwrite )
{
    XMLPropStyleContext::Finish( bOverwrite );
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
88753513085b91542956f0'>source/sv/sc/messages.po2
-rw-r--r--source/sw-TZ/sc/messages.po2
-rw-r--r--source/szl/sc/messages.po2
-rw-r--r--source/ta/sc/messages.po2
-rw-r--r--source/te/sc/messages.po2
-rw-r--r--source/tg/sc/messages.po2
-rw-r--r--source/th/sc/messages.po2
-rw-r--r--source/ti/sc/messages.po2
-rw-r--r--source/tn/sc/messages.po2
-rw-r--r--source/tr/sc/messages.po2
-rw-r--r--source/ts/sc/messages.po2
-rw-r--r--source/tt/sc/messages.po2
-rw-r--r--source/ug/sc/messages.po2
-rw-r--r--source/uk/sc/messages.po2
-rw-r--r--source/ur/sc/messages.po2
-rw-r--r--source/uz/sc/messages.po2
-rw-r--r--source/ve/sc/messages.po2
-rw-r--r--source/vec/sc/messages.po2
-rw-r--r--source/vi/sc/messages.po2
-rw-r--r--source/xh/sc/messages.po2
-rw-r--r--source/zh-CN/sc/messages.po2
-rw-r--r--source/zh-TW/sc/messages.po2
-rw-r--r--source/zu/sc/messages.po2
128 files changed, 129 insertions, 129 deletions
diff --git a/source/ab/sc/messages.po b/source/ab/sc/messages.po
index 592933e7644..af9c73f9764 100644
--- a/source/ab/sc/messages.po
+++ b/source/ab/sc/messages.po
@@ -3127,7 +3127,7 @@ msgstr "Аформула аҵакахьы ииагатәуп"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/af/sc/messages.po b/source/af/sc/messages.po
index cedc37f68e8..e7bcb829a45 100644
--- a/source/af/sc/messages.po
+++ b/source/af/sc/messages.po
@@ -3180,7 +3180,7 @@ msgstr "Skakel Formule om na Waarde"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr "Stringe sonder aanhalingstekens word geïnterpreteer as gedefinieerde name of verwysings of kolom/ry-etikette."
#. rHjns
diff --git a/source/am/sc/messages.po b/source/am/sc/messages.po
index 79a19e8a712..de96cf1de4c 100644
--- a/source/am/sc/messages.po
+++ b/source/am/sc/messages.po
@@ -3177,7 +3177,7 @@ msgstr "መቀመሪያ ወደ ዋጋ መቀየሪያ"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/an/sc/messages.po b/source/an/sc/messages.po
index b707865a5c7..10b8b63b65d 100644
--- a/source/an/sc/messages.po
+++ b/source/an/sc/messages.po
@@ -3434,7 +3434,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/ar/sc/messages.po b/source/ar/sc/messages.po
index 48a59c51fa0..0ec735f91bd 100644
--- a/source/ar/sc/messages.po
+++ b/source/ar/sc/messages.po
@@ -3191,7 +3191,7 @@ msgstr "تحويل الصّيغة إلى قيمة"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/as/sc/messages.po b/source/as/sc/messages.po
index 2cb1e5e4697..72820f7db10 100644
--- a/source/as/sc/messages.po
+++ b/source/as/sc/messages.po
@@ -3174,7 +3174,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/ast/sc/messages.po b/source/ast/sc/messages.po
index ffb5da51dec..43d5541684b 100644
--- a/source/ast/sc/messages.po
+++ b/source/ast/sc/messages.po
@@ -3178,7 +3178,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/az/sc/messages.po b/source/az/sc/messages.po
index be6fe463644..aa9da869cab 100644
--- a/source/az/sc/messages.po
+++ b/source/az/sc/messages.po
@@ -3127,7 +3127,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/be/sc/messages.po b/source/be/sc/messages.po
index 463e8db6aaf..130faf663ca 100644
--- a/source/be/sc/messages.po
+++ b/source/be/sc/messages.po
@@ -3175,7 +3175,7 @@ msgstr "Ператварыць формулу ў значэнне"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/bg/sc/messages.po b/source/bg/sc/messages.po
index 3d1171d9b47..766e9def2ae 100644
--- a/source/bg/sc/messages.po
+++ b/source/bg/sc/messages.po
@@ -3180,7 +3180,7 @@ msgstr "Преобразуване на формула в стойност"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr "Низовете без кавички се интерпретират като дефинирани имена, обръщения или етикети на колони/редове."
#. rHjns
diff --git a/source/bn-IN/sc/messages.po b/source/bn-IN/sc/messages.po
index 6c34af5bd13..88dd97db61a 100644
--- a/source/bn-IN/sc/messages.po
+++ b/source/bn-IN/sc/messages.po
@@ -3168,7 +3168,7 @@ msgstr "সূত্র মানে রূপান্তর করুন"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/bn/sc/messages.po b/source/bn/sc/messages.po
index 3fb6fbbb6fc..01b017a8455 100644
--- a/source/bn/sc/messages.po
+++ b/source/bn/sc/messages.po
@@ -3194,7 +3194,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/bo/sc/messages.po b/source/bo/sc/messages.po
index 19369de9d38..16a5bd03a4a 100644
--- a/source/bo/sc/messages.po
+++ b/source/bo/sc/messages.po
@@ -3203,7 +3203,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/br/sc/messages.po b/source/br/sc/messages.po
index c3115c779b7..f4894922a9d 100644
--- a/source/br/sc/messages.po
+++ b/source/br/sc/messages.po
@@ -3172,7 +3172,7 @@ msgstr "Amdreiñ ar reollun d'ur werzh"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/brx/sc/messages.po b/source/brx/sc/messages.po
index dd04f1937f6..f6173968537 100644
--- a/source/brx/sc/messages.po
+++ b/source/brx/sc/messages.po
@@ -3174,7 +3174,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/bs/sc/messages.po b/source/bs/sc/messages.po
index e0078388339..15eef1a2326 100644
--- a/source/bs/sc/messages.po
+++ b/source/bs/sc/messages.po
@@ -3183,7 +3183,7 @@ msgstr ""
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/ca-valencia/sc/messages.po b/source/ca-valencia/sc/messages.po
index 74cef4bf28a..7353e5c7c1c 100644
--- a/source/ca-valencia/sc/messages.po
+++ b/source/ca-valencia/sc/messages.po
@@ -3179,7 +3179,7 @@ msgstr "Converteix la fórmula en el valor"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr "Les cadenes sense cometes s'interpreten com a noms definits, referències o etiquetes de columnes o files."
#. rHjns
diff --git a/source/ca/sc/messages.po b/source/ca/sc/messages.po
index 28c5e27a7a2..0eb2cea94a5 100644
--- a/source/ca/sc/messages.po
+++ b/source/ca/sc/messages.po
@@ -3179,7 +3179,7 @@ msgstr "Converteix la fórmula en el valor"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr "Les cadenes sense cometes s'interpreten com a noms definits, referències o etiquetes de columnes o files."
#. rHjns
diff --git a/source/ckb/sc/messages.po b/source/ckb/sc/messages.po
index bd8703fc1ed..fb7abd15ee1 100644
--- a/source/ckb/sc/messages.po
+++ b/source/ckb/sc/messages.po
@@ -3108,7 +3108,7 @@ msgstr "هاوکێشە بگۆرە بۆ نرخ"
#. BywKj
#: sc/inc/globstr.hrc:531
msgctxt "STR_UNQUOTED_STRING"
-msgid "Strings without quotes are interpreted as defined names or references or column/row labels."
+msgid "Strings without double quotes are interpreted as defined names or references or column/row labels."
msgstr ""
#. rHjns
diff --git a/source/cs/sc/messages.po b/source/cs/sc/messages.po