/[packages]/updates/5/libreoffice/current/SOURCES/0001-remove-unused-ICoreParagraphStyle.patch
ViewVC logotype

Contents of /updates/5/libreoffice/current/SOURCES/0001-remove-unused-ICoreParagraphStyle.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1187504 - (show annotations) (download)
Sat Dec 30 02:36:47 2017 UTC (6 years, 3 months ago) by luigiwalser
File size: 11097 byte(s)
SILENT: 5.2.7 (sync with f25) - reverted

1 From 7c7e538cce25c74b2697db34738d37d363ab385f Mon Sep 17 00:00:00 2001
2 From: Noel Grandin <noel@peralex.com>
3 Date: Mon, 26 Sep 2016 13:01:42 +0200
4 Subject: [PATCH 1/2] remove unused ICoreParagraphStyle
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 which was introduced in
10 commit aef1e2dde5e53ba8416a393bbe155ef0c18511a7
11 Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
12 Date: Mon Dec 21 03:55:14 2015 +0100
13 move SwXStyle entirely into compilation unit
14
15 but Bjoern can't remember why he introduced it:
16 "Likely best to rip it out now and implement it properly when there is
17 a good testcase for this XML filter scenario ..."
18
19 Reviewed-on: https://gerrit.libreoffice.org/29297
20 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
21 Tested-by: Jenkins <ci@libreoffice.org>
22 (cherry picked from commit da870b35dd0cf8b7a987530e896b3e044f444908)
23
24 Change-Id: Iaef19131d804369436097ab445d6c192587f9d9f
25 Note: this commit is bogus but required for the next one
26 ---
27 sw/inc/unostyle.hxx | 7 ---
28 sw/source/core/unocore/unostyle.cxx | 10 -----
29 sw/source/filter/xml/xmlfmt.cxx | 50 ---------------------
30 sw/source/filter/xml/xmltexte.cxx | 87 -------------------------------------
31 sw/source/filter/xml/xmltexte.hxx | 3 --
32 5 files changed, 157 deletions(-)
33
34 diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
35 index 72b6b04..82c72bb 100644
36 --- a/sw/inc/unostyle.hxx
37 +++ b/sw/inc/unostyle.hxx
38 @@ -113,13 +113,6 @@ namespace sw
39 virtual css::document::XEventsSupplier& GetEventsSupplier() =0;
40 virtual ~ICoreFrameStyle() {};
41 };
42 - class ICoreParagraphStyle
43 - {
44 - public:
45 - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
46 - virtual const SwTextFormatColl* GetFormatColl() =0;
47 - virtual ~ICoreParagraphStyle() {};
48 - };
49 }
50
51 // access to all automatic style families
52 diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
53 index 7ec6ecb..894f3393 100644
54 --- a/sw/source/core/unocore/unostyle.cxx
55 +++ b/sw/source/core/unocore/unostyle.cxx
56 @@ -1059,7 +1059,6 @@ static SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum(SfxStyleFamily eFamily)
57 namespace
58 {
59 class theSwXStyleUnoTunnelId : public rtl::Static<UnoTunnelIdInit, theSwXStyleUnoTunnelId> {};
60 - class theCoreParagraphUnoTunnelId : public rtl::Static<UnoTunnelIdInit, theCoreParagraphUnoTunnelId> {};
61 }
62
63 const uno::Sequence<sal_Int8>& SwXStyle::getUnoTunnelId()
64 @@ -1067,11 +1066,6 @@ const uno::Sequence<sal_Int8>& SwXStyle::getUnoTunnelId()
65 return theSwXStyleUnoTunnelId::get().getSeq();
66 }
67
68 -const uno::Sequence<sal_Int8>& sw::ICoreParagraphStyle::getUnoTunnelId()
69 -{
70 - return theCoreParagraphUnoTunnelId::get().getSeq();
71 -}
72 -
73 sal_Int64 SAL_CALL SwXStyle::getSomething(const uno::Sequence<sal_Int8>& rId)
74 throw(uno::RuntimeException, std::exception)
75 {
76 @@ -1081,10 +1075,6 @@ sal_Int64 SAL_CALL SwXStyle::getSomething(const uno::Sequence<sal_Int8>& rId)
77 {
78 return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
79 }
80 - else if(0 == memcmp(sw::ICoreParagraphStyle::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16))
81 - {
82 - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(dynamic_cast<sw::ICoreParagraphStyle*>(this)));
83 - }
84 return 0;
85 }
86
87 diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
88 index dcf39d8..e0cdd96 100644
89 --- a/sw/source/filter/xml/xmlfmt.cxx
90 +++ b/sw/source/filter/xml/xmlfmt.cxx
91 @@ -204,10 +204,6 @@ public:
92
93
94 bool IsValid() const { return 0 != nCondition; }
95 -
96 - sal_uInt32 GetCondition() const { return nCondition; }
97 - sal_uInt32 GetSubCondition() const { return nSubCondition; }
98 - const OUString& GetApplyStyle() const { return sApplyStyle; }
99 };
100
101 SwXMLConditionContext_Impl::SwXMLConditionContext_Impl(
102 @@ -277,8 +273,6 @@ public:
103 sal_uInt16 nPrefix,
104 const OUString& rLocalName,
105 const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override;
106 -
107 - virtual void Finish( bool bOverwrite ) override;
108 };
109
110
111 @@ -359,50 +353,6 @@ SvXMLImportContext *SwXMLTextStyleContext_Impl::CreateChildContext(
112 return pContext;
113 }
114
115 -void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite )
116 -{
117 - XMLTextStyleContext::Finish( bOverwrite );
118 - if(!pConditions || XML_STYLE_FAMILY_TEXT_PARAGRAPH != GetFamily())
119 - return;
120 - uno::Reference<style::XStyle> xStyle = GetStyle();
121 - if(!xStyle.is())
122 - return;
123 - uno::Reference<lang::XUnoTunnel> xStyleTunnel(xStyle, uno::UNO_QUERY);
124 - if(!xStyleTunnel.is())
125 - return;
126 - sw::ICoreParagraphStyle* pCoreParagraphStyle(reinterpret_cast<sw::ICoreParagraphStyle*>(
127 - xStyleTunnel->getSomething(sw::ICoreParagraphStyle::getUnoTunnelId())));
128 - if(!pCoreParagraphStyle)
129 - return;
130 - SwTextFormatColl* pColl = const_cast<SwTextFormatColl*>(pCoreParagraphStyle->GetFormatColl());
131 - OSL_ENSURE( pColl, "Text collection not found" );
132 - if( !pColl || RES_CONDTXTFMTCOLL != pColl->Which() )
133 - return;
134 - SwDoc *pDoc = SwImport::GetDocFromXMLImport(GetImport());
135 - const size_t nCount = pConditions->size();
136 - OUString sName;
137 - for( size_t i = 0; i < nCount; i++ )
138 - {
139 - const SwXMLConditionContext_Impl *pCond = (*pConditions)[i];
140 - const OUString aDisplayName(
141 - GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
142 - pCond->GetApplyStyle() ) );
143 - SwStyleNameMapper::FillUIName(aDisplayName,
144 - sName,
145 - nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
146 - true);
147 - SwTextFormatColl* pCondColl = pDoc->FindTextFormatCollByName( sName );
148 - OSL_ENSURE( pCondColl,
149 - "SwXMLItemSetStyleContext_Impl::ConnectConditions: cond coll missing" );
150 - if( pCondColl )
151 - {
152 - SwCollCondition aCond( pCondColl, pCond->GetCondition(),
153 - pCond->GetSubCondition() );
154 - static_cast<SwConditionTextFormatColl*>(pColl)->InsertCondition( aCond );
155 - }
156 - }
157 -}
158 -
159 class SwXMLItemSetStyleContext_Impl : public SvXMLStyleContext
160 {
161 OUString sMasterPageName;
162 diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
163 index 823397e..f652a32 100644
164 --- a/sw/source/filter/xml/xmltexte.cxx
165 +++ b/sw/source/filter/xml/xmltexte.cxx
166 @@ -79,93 +79,6 @@ SwNoTextNode *SwXMLTextParagraphExport::GetNoTextNode(
167 return pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode();
168 }
169
170 -void SwXMLTextParagraphExport::exportStyleContent(
171 - const Reference< XStyle > & rStyle )
172 -{
173 -
174 - Reference<XUnoTunnel> xStyleTunnel(rStyle, UNO_QUERY);
175 - Reference<lang::XServiceInfo> xServiceInfo(rStyle, UNO_QUERY);
176 - if(!xStyleTunnel.is() || !xServiceInfo.is() || !xServiceInfo->supportsService("com.sun.star.style.ParagraphStyle"))
177 - return;
178 - sw::ICoreParagraphStyle* pCoreParagraphStyle(reinterpret_cast<sw::ICoreParagraphStyle*>(
179 - xStyleTunnel->getSomething(sw::ICoreParagraphStyle::getUnoTunnelId())));
180 - if(!pCoreParagraphStyle)
181 - return;
182 - const SwTextFormatColl* pColl(pCoreParagraphStyle->GetFormatColl());
183 - OSL_ENSURE( pColl, "There is the text collection?" );
184 - if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() )
185 - {
186 - const SwFormatCollConditions& rConditions =
187 - static_cast<const SwConditionTextFormatColl *>(pColl)->GetCondColls();
188 - for( size_t i=0; i < rConditions.size(); ++i )
189 - {
190 - const SwCollCondition& rCond = *rConditions[i];
191 -
192 - enum XMLTokenEnum eFunc = XML_TOKEN_INVALID;
193 - OUString sVal;
194 - switch( rCond.GetCondition() )
195 - {
196 - case PARA_IN_LIST:
197 - eFunc = XML_LIST_LEVEL;
198 - sVal = OUString::number(rCond.GetSubCondition()+1);
199 - break;
200 - case PARA_IN_OUTLINE:
201 - eFunc = XML_OUTLINE_LEVEL;
202 - sVal = OUString::number(rCond.GetSubCondition()+1);
203 - break;
204 - case PARA_IN_FRAME:
205 - eFunc = XML_TEXT_BOX;
206 - break;
207 - case PARA_IN_TABLEHEAD:
208 - eFunc = XML_TABLE_HEADER;
209 - break;
210 - case PARA_IN_TABLEBODY:
211 - eFunc = XML_TABLE;
212 - break;
213 - case PARA_IN_SECTION:
214 - eFunc = XML_SECTION;
215 - break;
216 - case PARA_IN_FOOTENOTE:
217 - eFunc = XML_FOOTNOTE;
218 - break;
219 - case PARA_IN_FOOTER:
220 - eFunc = XML_FOOTER;
221 - break;
222 - case PARA_IN_HEADER:
223 - eFunc = XML_HEADER;
224 - break;
225 - case PARA_IN_ENDNOTE:
226 - eFunc = XML_ENDNOTE;
227 - break;
228 - }
229 - OSL_ENSURE( eFunc != XML_TOKEN_INVALID,
230 - "SwXMLExport::ExportFormat: unknown condition" );
231 - if( eFunc != XML_TOKEN_INVALID )
232 - {
233 - OUString sCond = GetXMLToken(eFunc) + "()";
234 - if( !sVal.isEmpty() )
235 - {
236 - sCond += "=" + sVal;
237 - }
238 -
239 - GetExport().AddAttribute( XML_NAMESPACE_STYLE,
240 - XML_CONDITION, sCond );
241 - OUString aString;
242 - SwStyleNameMapper::FillProgName(
243 - rCond.GetTextFormatColl()->GetName(),
244 - aString,
245 - nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
246 - true);
247 - aString = GetExport().EncodeStyleName( aString );
248 - GetExport().AddAttribute( XML_NAMESPACE_STYLE,
249 - XML_APPLY_STYLE_NAME, aString );
250 - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
251 - XML_MAP, true, true );
252 - }
253 - }
254 - }
255 -}
256 -
257 SwXMLTextParagraphExport::SwXMLTextParagraphExport(
258 SwXMLExport& rExp,
259 SvXMLAutoStylePoolP& _rAutoStylePool ) :
260 diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx
261 index e714994..3ec9a6c 100644
262 --- a/sw/source/filter/xml/xmltexte.hxx
263 +++ b/sw/source/filter/xml/xmltexte.hxx
264 @@ -43,9 +43,6 @@ class SwXMLTextParagraphExport : public XMLTextParagraphExport
265 const css::uno::Reference < css::beans::XPropertySet >& rPropSet );
266
267 protected:
268 - virtual void exportStyleContent(
269 - const css::uno::Reference< css::style::XStyle > & rStyle ) override;
270 -
271 virtual void _collectTextEmbeddedAutoStyles(
272 const css::uno::Reference< css::beans::XPropertySet > & rPropSet ) override;
273 virtual void _exportTextEmbedded(
274 --
275 2.9.4
276

  ViewVC Help
Powered by ViewVC 1.1.30