LibreOffice Module sw (master)  1
xmltexti.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
23 #include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
24 #include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
25 #include <com/sun/star/embed/XEmbeddedObject.hpp>
26 #include <com/sun/star/embed/Aspects.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include <com/sun/star/task/XInteractionHandler.hpp>
29 #include <o3tl/any.hxx>
30 #include <osl/diagnose.h>
31 #include <rtl/ustrbuf.hxx>
32 #include <sal/log.hxx>
33 #include <comphelper/classids.hxx>
34 #include <com/sun/star/lang/XUnoTunnel.hpp>
35 #include <xmloff/prstylei.hxx>
36 #include <xmloff/maptype.hxx>
37 #include <xmloff/xmlprmap.hxx>
38 #include <xmloff/txtprmap.hxx>
39 #include <xmloff/i18nmap.hxx>
40 #include <xmloff/xmlimppr.hxx>
41 #include <TextCursorHelper.hxx>
42 #include <unoframe.hxx>
43 #include <doc.hxx>
46 #include <fmtfsize.hxx>
47 #include <fmtanchr.hxx>
48 #include <fmtcntnt.hxx>
49 #include "xmlimp.hxx"
50 #include "xmltbli.hxx"
51 #include "xmltexti.hxx"
54 #include <SwAppletImpl.hxx>
55 #include <ndole.hxx>
56 #include <docsh.hxx>
57 #include <sfx2/docfile.hxx>
58 #include <vcl/svapp.hxx>
60 #include <svtools/embedhlp.hxx>
61 #include <svl/urihelper.hxx>
62 #include <sfx2/frmdescr.hxx>
63 #include <tools/globname.hxx>
64 #include <tools/UnitConversion.hxx>
65 
66 using namespace ::com::sun::star;
67 using namespace ::com::sun::star::uno;
68 using namespace ::com::sun::star::lang;
69 using namespace ::com::sun::star::text;
70 using namespace ::com::sun::star::frame;
71 using namespace ::com::sun::star::beans;
72 using namespace xml::sax;
73 
74 namespace {
75 
76 struct XMLServiceMapEntry_Impl
77 {
78  const char *sFilterService;
79  sal_Int32 nFilterServiceLen;
80 
81  sal_uInt32 n1;
82  sal_uInt16 n2, n3;
83  sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
84 };
85 
86 }
87 
88 #define SERVICE_MAP_ENTRY( app, s ) \
89  { XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1, \
90  SO3_##s##_CLASSID }
91 
92 const XMLServiceMapEntry_Impl aServiceMap[] =
93 {
95  SERVICE_MAP_ENTRY( CALC, SC ),
96  SERVICE_MAP_ENTRY( DRAW, SDRAW ),
97  SERVICE_MAP_ENTRY( IMPRESS, SIMPRESS ),
98  SERVICE_MAP_ENTRY( CHART, SCH ),
99  SERVICE_MAP_ENTRY( MATH, SM ),
100  { nullptr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
101 };
102 static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
103  sal_Int32 nHeight, sal_Int32 nWidth,
104  Size *pTwipSize = nullptr )
105 {
106  if( nWidth > 0 && nHeight > 0 )
107  {
108  nWidth = o3tl::toTwips(nWidth, o3tl::Length::mm100);
109  if( nWidth < MINFLY )
110  nWidth = MINFLY;
111  nHeight = o3tl::toTwips(nHeight, o3tl::Length::mm100);
112  if( nHeight < MINFLY )
113  nHeight = MINFLY;
114  rItemSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) );
115  }
116 
117  SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
118  rItemSet.Put( aAnchor );
119 
120  if( pTwipSize )
121  {
122  pTwipSize->setWidth( nWidth );
123  pTwipSize->setHeight( nHeight);
124  }
125 }
126 
127 static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
128  sal_Int64 nAspect,
129  const Size& aVisSize,
130  const MapUnit& aUnit )
131 {
132  if( !(xObj.is() && nAspect != embed::Aspects::MSOLE_ICON) )
133  return;
134 
135  // convert the visual area to the objects units
136  MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
137  Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit));
138  awt::Size aSz;
139  aSz.Width = aObjVisSize.Width();
140  aSz.Height = aObjVisSize.Height();
141 
142  try
143  {
144  xObj->setVisualAreaSize( nAspect, aSz );
145  }
146  catch( uno::Exception& )
147  {
148  OSL_FAIL( "Couldn't set visual area of the object!" );
149  }
150 }
151 
153  const uno::Reference < XModel>& rModel,
154  SvXMLImport& rImport,
155  const uno::Reference<XPropertySet> & rInfoSet,
156  bool bInsertM, bool bStylesOnlyM,
157  bool bBlockM, bool bOrganizerM ) :
158  XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, true/*bProgress*/,
159  bBlockM, bOrganizerM ),
160  m_pRedlineHelper( nullptr )
161 {
162  uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
164  bInsertM || bBlockM, xDocPropSet, rInfoSet );
165 }
166 
168 {
169  // the redline helper destructor sets properties on the document
170  // and may throw an exception while doing so... catch this
171  try
172  {
173  delete m_pRedlineHelper;
174  }
175  catch ( const RuntimeException& )
176  {
177  // ignore
178  }
179 }
180 
182  SvXMLImport& rImport,
183  sal_Int32 /*nElement*/,
184  const uno::Reference< XFastAttributeList > & xAttrList )
185 {
186  return new SwXMLTableContext( static_cast<SwXMLImport&>(rImport), xAttrList );
187 }
188 
190 {
191  uno::Reference<XUnoTunnel> xCursorTunnel(
192  const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY );
193  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
194  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
195  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
196  SwDoc *pDoc = pTextCursor ? pTextCursor->GetDoc() : nullptr;
197 
198  return pDoc && pDoc->IsInHeaderFooter( pTextCursor->GetPaM()->GetPoint()->nNode );
199 }
200 
201 static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat )
202 {
203  SwOLENode *pOLENd = nullptr;
204  if( pFrameFormat )
205  {
206  const SwFormatContent& rContent = pFrameFormat->GetContent();
207  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
208  pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
209  }
210  OSL_ENSURE( pOLENd, "Where is the OLE node" );
211  return pOLENd;
212 }
213 
214 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
215  SvXMLImport& rImport,
216  const OUString& rHRef,
217  const OUString& rStyleName,
218  const OUString& rTableName,
219  sal_Int32 nWidth, sal_Int32 nHeight )
220 {
221  // this method will modify the document directly -> lock SolarMutex
222  SolarMutexGuard aGuard;
223 
224  uno::Reference < XPropertySet > xPropSet;
225 
226  sal_Int32 nPos = rHRef.indexOf( ':' );
227  if( -1 == nPos )
228  return xPropSet;
229 
230  OUString aObjName( rHRef.copy( nPos+1) );
231 
232  if( aObjName.isEmpty() )
233  return xPropSet;
234 
235  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
236  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
237  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
238  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
239  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
240 
242  RES_FRMATR_END> );
243  Size aTwipSize( 0, 0 );
244  tools::Rectangle aVisArea( 0, 0, nWidth, nHeight );
245  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
246  &aTwipSize );
247 
248  SwFrameFormat *pFrameFormat = nullptr;
249  SwOLENode *pOLENd = nullptr;
250  if( rHRef.startsWith("vnd.sun.star.ServiceName:") )
251  {
252  bool bInsert = false;
253  SvGlobalName aClassName;
254  const XMLServiceMapEntry_Impl *pEntry = aServiceMap;
255  while( pEntry->sFilterService )
256  {
257  if( aObjName.equalsAsciiL( pEntry->sFilterService,
258  pEntry->nFilterServiceLen ) )
259  {
260  aClassName = SvGlobalName( pEntry->n1, pEntry->n2,
261  pEntry->n3, pEntry->n4,
262  pEntry->n5, pEntry->n6,
263  pEntry->n7, pEntry->n8,
264  pEntry->n9, pEntry->n10,
265  pEntry->n11 );
266  bInsert = true;
267  break;
268  }
269  pEntry++;
270  }
271 
272  if( bInsert )
273  {
274  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
275  try
276  {
277  // create object with desired ClassId
278  uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
279  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
280  uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({
281  { "DefaultParentBaseURL", Any(GetXMLImport().GetBaseURL()) }
282  }));
283  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
284  aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
285  if ( xObj.is() )
286  {
287  //TODO/LATER: is it enough to only set the VisAreaSize?
288  lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
289  }
290 
291  if( pTextCursor )
292  {
293  pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
294  *pTextCursor->GetPaM(),
295  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
296  &aItemSet);
297  pOLENd = lcl_GetOLENode( pFrameFormat );
298  }
299 
300  if( pOLENd )
301  aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
302  }
303  catch ( uno::Exception& )
304  {
305  }
306  }
307  }
308  else
309  {
310  // check whether an object with this name already exists in the document
311  OUString aName;
313  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
314  {
315  SwOLENode* pExistingOLENd = pNd->GetOLENode();
316  if( pExistingOLENd )
317  {
318  OUString aExistingName = pExistingOLENd->GetOLEObj().GetCurrentPersistName();
319  if ( aExistingName == aObjName )
320  {
321  OSL_FAIL( "The document contains duplicate object references, means it is partially broken, please let developers know how this document was generated!" );
322 
323  OUString aTmpName = pDoc->GetPersist()->GetEmbeddedObjectContainer().CreateUniqueObjectName();
324  try
325  {
326  pDoc->GetPersist()->GetStorage()->copyElementTo( aObjName,
327  pDoc->GetPersist()->GetStorage(),
328  aTmpName );
329  aName = aTmpName;
330  }
331  catch ( uno::Exception& )
332  {
333  OSL_FAIL( "Couldn't create a copy of the object!" );
334  }
335 
336  break;
337  }
338  }
339  }
340 
341  if ( aName.isEmpty() )
342  aName = aObjName;
343 
344  // the correct aspect will be set later
345  // TODO/LATER: Actually it should be set here
346  if( pTextCursor )
347  {
348  pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCursor->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr );
349  pOLENd = lcl_GetOLENode( pFrameFormat );
350  }
351  aObjName = aName;
352  }
353 
354  if( !pFrameFormat )
355  return xPropSet;
356 
357  if( IsInsertMode() )
358  {
359  if( !pOLENd )
360  pOLENd = lcl_GetOLENode( pFrameFormat );
361  if( pOLENd )
362  pOLENd->SetOLESizeInvalid( true );
363  }
364 
366  *pDoc, pFrameFormat), uno::UNO_QUERY);
368  {
369  // req for z-order
370  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
371  }
372  if( !rTableName.isEmpty() )
373  {
374  const SwFormatContent& rContent = pFrameFormat->GetContent();
375  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
376  SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
377  OSL_ENSURE( pOLENode, "Where is the OLE node" );
378 
379  OUStringBuffer aBuffer( rTableName.getLength() );
380  bool bQuoted = false;
381  bool bEscape = false;
382  bool bError = false;
383  for( sal_Int32 i=0; i < rTableName.getLength(); i++ )
384  {
385  bool bEndOfNameFound = false;
386  sal_Unicode c = rTableName[i];
387  switch( c )
388  {
389  case '\'':
390  if( bEscape )
391  {
392  aBuffer.append( c );
393  bEscape = false;
394  }
395  else if( bQuoted )
396  {
397  bEndOfNameFound = true;
398  }
399  else if( 0 == i )
400  {
401  bQuoted = true;
402  }
403  else
404  {
405  bError = true;
406  }
407  break;
408  case '\\':
409  if( bEscape )
410  {
411  aBuffer.append( c );
412  bEscape = false;
413  }
414  else
415  {
416  bEscape = true;
417  }
418  break;
419  case ' ':
420  case '.':
421  if( !bQuoted )
422  {
423  bEndOfNameFound = true;
424  }
425  else
426  {
427  aBuffer.append( c );
428  bEscape = false;
429  }
430  break;
431  default:
432  {
433  aBuffer.append( c );
434  bEscape = false;
435  }
436  break;
437  }
438  if( bError || bEndOfNameFound )
439  break;
440  }
441  if( !bError )
442  {
443  OUString sTableName( aBuffer.makeStringAndClear() );
444  pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) );
445  }
446  }
447 
448  sal_Int64 nDrawAspect = 0;
449  const XMLPropStyleContext *pStyle = nullptr;
450  bool bHasSizeProps = false;
451  if( !rStyleName.isEmpty() )
452  {
453  pStyle = FindAutoFrameStyle( rStyleName );
454  if( pStyle )
455  {
457  pStyle->GetStyles()
458  ->GetImportPropertyMapper(pStyle->GetFamily());
459  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
460  if( xImpPrMap.is() )
461  {
463  xImpPrMap->getPropertySetMapper();
464 
465  sal_Int32 nCount = pStyle->GetProperties().size();
466  for( sal_Int32 i=0; i < nCount; i++ )
467  {
468  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
469  sal_Int32 nIdx = rProp.mnIndex;
470  if( -1 == nIdx )
471  continue;
472 
473  switch( rPropMapper->GetEntryContextId(nIdx) )
474  {
476  {
477  sal_Int32 nVal = 0;
478  rProp.maValue >>= nVal;
479  aVisArea.SetPosX( nVal );
480  }
481  break;
483  {
484  sal_Int32 nVal = 0;
485  rProp.maValue >>= nVal;
486  aVisArea.SetPosY( nVal );
487  }
488  break;
490  {
491  sal_Int32 nVal = 0;
492  rProp.maValue >>= nVal;
493  aVisArea.setWidth( nVal );
494  bHasSizeProps = true;
495  }
496  break;
498  {
499  sal_Int32 nVal = 0;
500  rProp.maValue >>= nVal;
501  aVisArea.setHeight( nVal );
502  bHasSizeProps = true;
503  }
504  break;
505  case CTF_OLE_DRAW_ASPECT:
506  {
507  rProp.maValue >>= nDrawAspect;
508 
509  if ( !nDrawAspect )
510  nDrawAspect = embed::Aspects::MSOLE_CONTENT;
511 
512  if ( pOLENd )
513  pOLENd->GetOLEObj().GetObject().SetViewAspect( nDrawAspect );
514  }
515  break;
516  }
517  }
518  }
519  }
520  }
521 
522  if ( bHasSizeProps )
523  {
524  uno::Reference < embed::XEmbeddedObject > xObj =
526  if( xObj.is() )
527  lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
528  aVisArea.GetSize(), MapUnit::Map100thMM );
529  }
530 
531  return xPropSet;
532 }
533 
534 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
535  SvXMLImport& rImport,
536  const OUString& rHRef,
537  const OUString& /*rStyleName*/,
538  const OUString& /*rTableName*/,
539  sal_Int32 nWidth, sal_Int32 nHeight )
540 {
541  // this method will modify the document directly -> lock SolarMutex
542  SolarMutexGuard aGuard;
543 
544  uno::Reference < XPropertySet > xPropSet;
545 
546  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
547  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
548  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
549  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
550  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
551 
553  RES_FRMATR_END> );
554  Size aTwipSize( 0, 0 );
555  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
556  &aTwipSize );
557 
558  // We'll need a (valid) URL. If we don't have do not insert the link and return early.
559  // Copy URL into URL object on the way.
560  INetURLObject aURLObj;
561  bool bValidURL = !rHRef.isEmpty() &&
563  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
564  if( !bValidURL )
565  return xPropSet;
566 
567  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
568  try
569  {
570  // create object with desired ClassId
571  uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
572  embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
573 
574  uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
575  aMediaDescriptor[0].Name = "URL";
576  aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
577 
578  if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
579  {
580  uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
581  if ( xInteraction.is() )
582  {
583  aMediaDescriptor.realloc( 2 );
584  aMediaDescriptor[1].Name = "InteractionHandler";
585  aMediaDescriptor[1].Value <<= xInteraction;
586  }
587 
588  const auto nLen = aMediaDescriptor.getLength() + 1;
589  aMediaDescriptor.realloc(nLen);
590  aMediaDescriptor[nLen - 1].Name = "Referer";
591  aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
592  }
593 
594  uno::Reference < embed::XEmbeddedObject > xObj(
595  xFactory->createInstanceLink(
596  xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
597  uno::UNO_QUERY_THROW );
598 
599  {
600  SwFrameFormat *const pFrameFormat =
602  *pTextCursor->GetPaM(),
603  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
604  &aItemSet );
605 
606  // TODO/LATER: in future may need a way to set replacement image url to the link ( may be even to the object ), needs oasis cws???
607 
609  *pDoc, pFrameFormat), uno::UNO_QUERY);
611  {
613  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
614  }
615  }
616  }
617  catch ( uno::Exception& )
618  {
619  }
620 
621  // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object?
622 
623  return xPropSet;
624 }
625 
626 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
627  const OUString &rName,
628  const OUString &rCode,
629  bool bMayScript,
630  const OUString& rHRef,
631  sal_Int32 nWidth, sal_Int32 nHeight )
632 {
633  // this method will modify the document directly -> lock SolarMutex
634  SolarMutexGuard aGuard;
635 
636  uno::Reference < XPropertySet > xPropSet;
637  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
638  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
639  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
640  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
641  SwDoc *pDoc = pTextCursor->GetDoc();
642 
644  RES_FRMATR_END> );
645  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
646 
647  SwApplet_Impl aAppletImpl ( aItemSet );
648 
649  OUString sCodeBase;
650  if( !rHRef.isEmpty() )
651  sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef );
652 
653  aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() );
654 
655  // set the size of the applet
656  lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
657  embed::Aspects::MSOLE_CONTENT,
658  Size( nWidth, nHeight ),
659  MapUnit::Map100thMM );
660 
661  SwFrameFormat *const pFrameFormat =
662  pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(),
663  ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT),
664  &aAppletImpl.GetItemSet());
666  *pDoc, pFrameFormat), uno::UNO_QUERY);
668  {
669  // req for z-order
670  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
671  }
672 
673  return xPropSet;
674 }
675 
676 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
677  const OUString &rMimeType,
678  const OUString& rHRef,
679  sal_Int32 nWidth, sal_Int32 nHeight )
680 {
681  uno::Reference < XPropertySet > xPropSet;
682  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
683  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
684  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
685  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
686  SwDoc *pDoc = pTextCursor->GetDoc();
687 
689  RES_FRMATR_END> );
690  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
691 
692  // We'll need a (valid) URL, or we need a MIME type. If we don't have
693  // either, do not insert plugin and return early. Copy URL into URL object
694  // on the way.
695  INetURLObject aURLObj;
696 
697  bool bValidURL = !rHRef.isEmpty() &&
698  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
699  bool bValidMimeType = !rMimeType.isEmpty();
700  if( !bValidURL && !bValidMimeType )
701  return xPropSet;
702 
703  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
704  try
705  {
706  // create object with desired ClassId
707  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
708  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
709  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
710  aClass, OUString(), xStorage, "DummyName",
711  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
712 
713  // set size to the object
715  embed::Aspects::MSOLE_CONTENT,
716  Size( nWidth, nHeight ),
717  MapUnit::Map100thMM );
718 
720  {
721  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
722  if ( xSet.is() )
723  {
724  if( bValidURL )
725  xSet->setPropertyValue("PluginURL",
727  if( bValidMimeType )
728  xSet->setPropertyValue("PluginMimeType",
729  makeAny( rMimeType ) );
730  }
731 
732  SwFrameFormat *const pFrameFormat =
734  *pTextCursor->GetPaM(),
735  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
736  &aItemSet);
738  *pDoc, pFrameFormat), uno::UNO_QUERY);
740  {
742  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
743  }
744  }
745  }
746  catch ( uno::Exception& )
747  {
748  }
749 
750  return xPropSet;
751 }
753  const OUString& rName,
754  const OUString& rHRef,
755  const OUString& rStyleName,
756  sal_Int32 nWidth, sal_Int32 nHeight )
757 {
758  // this method will modify the document directly -> lock SolarMutex
759  SolarMutexGuard aGuard;
760 
761  uno::Reference < XPropertySet > xPropSet;
762  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
763  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
764  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
765  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
766  SwDoc *pDoc = pTextCursor->GetDoc();
767 
769  RES_FRMATR_END> );
770  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
771 
772  ScrollingMode eScrollMode = ScrollingMode::Auto;
773  bool bHasBorder = false;
774  bool bIsBorderSet = false;
775  Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
776  const XMLPropStyleContext *pStyle = nullptr;
777  if( !rStyleName.isEmpty() )
778  {
779  pStyle = FindAutoFrameStyle( rStyleName );
780  if( pStyle )
781  {
783  pStyle->GetStyles()
784  ->GetImportPropertyMapper(pStyle->GetFamily());
785  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
786  if( xImpPrMap.is() )
787  {
789  xImpPrMap->getPropertySetMapper();
790 
791  sal_Int32 nCount = pStyle->GetProperties().size();
792  for( sal_Int32 i=0; i < nCount; i++ )
793  {
794  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
795  sal_Int32 nIdx = rProp.mnIndex;
796  if( -1 == nIdx )
797  continue;
798 
799  switch( rPropMapper->GetEntryContextId(nIdx) )
800  {
802  {
803  bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
804  eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
805  }
806  break;
808  {
809  bHasBorder = *o3tl::doAccess<bool>(rProp.maValue);
810  bIsBorderSet = true;
811  }
812  break;
814  {
815  sal_Int32 nVal = SIZE_NOT_SET;
816  rProp.maValue >>= nVal;
817  aMargin.setWidth( nVal );
818  }
819  break;
821  {
822  sal_Int32 nVal = SIZE_NOT_SET;
823  rProp.maValue >>= nVal;
824  aMargin.setHeight( nVal );
825  }
826  break;
827  }
828  }
829  }
830  }
831  }
832 
833  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
834  try
835  {
836  // create object with desired ClassId
837  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
838  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
839  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
840  aClass, OUString(), xStorage, "DummyName",
841  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
842 
843  // set size to the object
845  embed::Aspects::MSOLE_CONTENT,
846  Size( nWidth, nHeight ),
847  MapUnit::Map100thMM );
848 
850  {
851  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
852  if ( xSet.is() )
853  {
854  xSet->setPropertyValue("FrameURL",
856  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
857 
858  xSet->setPropertyValue("FrameName",
859  makeAny( rName ) );
860 
861  if ( eScrollMode == ScrollingMode::Auto )
862  xSet->setPropertyValue("FrameIsAutoScroll",
863  makeAny( true ) );
864  else
865  xSet->setPropertyValue("FrameIsScrollingMode",
866  makeAny( eScrollMode == ScrollingMode::Yes ) );
867 
868  if ( bIsBorderSet )
869  xSet->setPropertyValue("FrameIsBorder",
870  makeAny( bHasBorder ) );
871  else
872  xSet->setPropertyValue("FrameIsAutoBorder",
873  makeAny( true ) );
874 
875  xSet->setPropertyValue("FrameMarginWidth",
876  makeAny( sal_Int32( aMargin.Width() ) ) );
877 
878  xSet->setPropertyValue("FrameMarginHeight",
879  makeAny( sal_Int32( aMargin.Height() ) ) );
880  }
881 
882  SwFrameFormat *const pFrameFormat =
884  *pTextCursor->GetPaM(),
885  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
886  &aItemSet);
888  *pDoc, pFrameFormat), uno::UNO_QUERY);
890  {
891  // req for z-order
893  static_cast<SwFlyFrameFormat*>(pFrameFormat));
894  }
895  }
896  }
897  catch ( uno::Exception& )
898  {
899  }
900 
901  return xPropSet;
902 }
903 
905  const uno::Reference < XPropertySet > &rPropSet,
906  std::map < const OUString, OUString > &rParamMap)
907 {
908  // this method will modify the document directly -> lock SolarMutex
909  SolarMutexGuard aGuard;
910 
911  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
912  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
913  SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xCursorTunnel);
914  OSL_ENSURE( pFrame, "SwXFrame missing" );
915  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
916  const SwFormatContent& rContent = pFrameFormat->GetContent();
917  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
918  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
919  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
920 
921  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
922  if ( !svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) )
923  return;
924 
925  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
926  if ( !xSet.is() )
927  return;
928 
929  const sal_Int32 nCount = rParamMap.size();
930  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
931 
932  sal_Int32 nIndex=0;
933  for (const auto& rParam : rParamMap )
934  {
935  aCommandSequence[nIndex].Name = rParam.first;
936  aCommandSequence[nIndex].Handle = -1;
937  aCommandSequence[nIndex].Value <<= rParam.second;
938  aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
939  ++nIndex;
940  }
941 
942  // unfortunately the names of the properties are depending on the object
943  OUString aParaName("AppletCommands");
944  try
945  {
946  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
947  }
948  catch ( uno::Exception& )
949  {
950  aParaName = "PluginCommands";
951  try
952  {
953  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
954  }
955  catch ( uno::Exception& )
956  {
957  }
958  }
959 }
960 
961 // redlining helper methods
962 // (override to provide the real implementation)
964  const OUString& rType,
965  const OUString& rId,
966  const OUString& rAuthor,
967  const OUString& rComment,
968  const util::DateTime& rDateTime,
969  bool bMergeLastPara)
970 {
971  // create redline helper on demand
972  OSL_ENSURE(nullptr != m_pRedlineHelper, "helper should have been created in constructor");
973  if (nullptr != m_pRedlineHelper)
974  m_pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
975  bMergeLastPara);
976 }
977 
978 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
979  uno::Reference<XTextCursor> & rOldCursor,
980  const OUString& rId)
981 {
982  uno::Reference<XTextCursor> xRet;
983 
984  if (nullptr != m_pRedlineHelper)
985  {
986  xRet = m_pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
987  }
988 
989  return xRet;
990 }
991 
993  const OUString& rId,
994  bool bStart,
995  bool bIsOutsideOfParagraph)
996 {
997  if (nullptr != m_pRedlineHelper) {
998  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
999  m_pRedlineHelper->SetCursor(rId, bStart, xTextRange,
1000  bIsOutsideOfParagraph);
1001  }
1002  // else: ignore redline (wasn't added before, else we'd have a helper)
1003 }
1004 
1006 {
1007  OUString rId = GetOpenRedlineId();
1008  if ((nullptr != m_pRedlineHelper) && !rId.isEmpty())
1009  {
1012  }
1013  // else: ignore redline (wasn't added before, or no open redline ID
1014 }
1015 
1016 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
1017 {
1018  if ( nullptr != m_pRedlineHelper )
1019  m_pRedlineHelper->SetShowChanges( bShowChanges );
1020 }
1021 
1022 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
1023 {
1024  if ( nullptr != m_pRedlineHelper )
1025  m_pRedlineHelper->SetRecordChanges( bRecordChanges );
1026 }
1027 
1029  const Sequence<sal_Int8> & rKey )
1030 {
1031  if ( nullptr != m_pRedlineHelper )
1033 }
1034 
1035 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::embed::XEmbeddedObject > & GetApplet() const
XmlStyleFamily GetFamily() const
#define SERVICE_MAP_ENTRY(app, s)
Definition: xmltexti.cxx:88
sal_Int32 nIndex
virtual css::uno::Reference< css::text::XTextCursor > RedlineCreateText(css::uno::Reference< css::text::XTextCursor > &rOldCursor, const OUString &rId) override
merge last paragraph
Definition: xmltexti.cxx:978
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:1022
constexpr auto toTwips(N number, Length from)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
void setWidth(tools::Long nWidth)
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
static constexpr auto Items
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
int n1
const ::std::vector< XMLPropertyState > & GetProperties() const
#define SO3_IFRAME_CLASSID
#define MINFLY
Definition: swtypes.hxx:62
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph) override
ID used to RedlineAdd() call.
Definition: xmltexti.cxx:992
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:909
Definition: doc.hxx:188
constexpr sal_uInt16 RES_FRMATR_END(133)
#define CTF_OLE_VIS_AREA_TOP
sal_Int32 mnIndex
css::uno::Sequence< sal_Int8 > GetByteSequence() const
#define CTF_OLE_VIS_AREA_WIDTH
#define CTF_OLE_VIS_AREA_LEFT
SfxItemSet & GetItemSet()
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define CTF_FRAME_DISPLAY_SCROLLBAR
SvI18NMap & GetRenameMap()
CALC
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1552
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOOoLink(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTableName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:534
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertFloatingFrame(const OUString &rName, const OUString &rHRef, const OUString &rStyleName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:752
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
css::uno::Reference< css::embed::XStorage > const & GetStorage()
constexpr tools::Long Width() const
void SetRecordChanges(bool bRecordChanges)
sal_uInt16 sal_Unicode
int n2
ScrollingMode
virtual void RedlineAdd(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastPara) override
Definition: xmltexti.cxx:963
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
DRAW
void SetShowChanges(bool bShowChanges)
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:961
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertApplet(const OUString &rName, const OUString &rCode, bool bMayScript, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:626
int nCount
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
void CreateApplet(const OUString &rCode, const OUString &rName, bool bMayScript, const OUString &rCodeBase, const OUString &rBaseURL)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
const SvXMLStylesContext * GetStyles() const
virtual SwFlyFrameFormat * InsertOLE(const SwPaM &rRg, const OUString &rObjName, sal_Int64 nAspect, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet)=0
const XMLServiceMapEntry_Impl aServiceMap[]
Definition: xmltexti.cxx:92
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:69
css::uno::Reference< css::text::XTextCursor > CreateRedlineTextSection(css::uno::Reference< css::text::XTextCursor > const &xOldCursor, const OUString &rId)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:676
virtual void SetShowChanges(bool bShowChanges) override
Definition: xmltexti.cxx:1016
#define XML_TEXT_RENAME_TYPE_TABLE
WRITER
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOLEObject(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTableName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:214
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Style of a layout element.
Definition: frmfmt.hxx:59
int i
SvXMLImport & GetXMLImport()
MATH
FlyAnchors.
Definition: fmtanchr.hxx:34
virtual void endAppletOrPlugin(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, std::map< const OUString, OUString > &rParamMap) override
Definition: xmltexti.cxx:904
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1349
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwXMLTextImportHelper(const css::uno::Reference< css::frame::XModel > &rModel, SvXMLImport &rImport, const css::uno::Reference< css::beans::XPropertySet > &rInfoSet, bool bInsertM, bool bStylesOnlyM, bool bBlockM, bool bOrganizerM)
Definition: xmltexti.cxx:152
virtual bool IsInHeaderFooter() const override
Definition: xmltexti.cxx:189
void SetPosY(tools::Long y)
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual ~SwXMLTextImportHelper() override
Definition: xmltexti.cxx:167
bool IsInsertMode() const
#define CTF_FRAME_DISPLAY_BORDER
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:201
static void lcl_setObjectVisualArea(const uno::Reference< embed::XEmbeddedObject > &xObj, sal_Int64 nAspect, const Size &aVisSize, const MapUnit &aUnit)
Definition: xmltexti.cxx:127
#define CTF_FRAME_MARGIN_VERT
Frame cannot be moved in Var-direction.
#define CTF_OLE_DRAW_ASPECT
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey) override
Definition: xmltexti.cxx:1028
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
void SetCursor(const OUString &rId, bool bStart, css::uno::Reference< css::text::XTextRange > const &rRange, bool bIsOutsideOfParagraph)
css::uno::Reference< css::embed::XEmbeddedObject > GetEmbeddedObject(const OUString &, OUString const *pBaseURL=nullptr)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void SetChartTableName(const OUString &rNm)
Definition: ndole.hxx:153
void AdjustStartNodeCursor(const OUString &rId)
Adjust the start (end) position for a redline that begins in a start node.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
XMLRedlineImportHelper * m_pRedlineHelper
Definition: xmltexti.hxx:29
constexpr Size GetSize() const
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
std::unique_ptr< char[]> aBuffer
void SetViewAspect(sal_Int64 nAspect)
css::uno::Any maValue
static void lcl_putHeightAndWidth(SfxItemSet &rItemSet, sal_Int32 nHeight, sal_Int32 nWidth, Size *pTwipSize=nullptr)
Definition: xmltexti.cxx:102
#define CTF_OLE_VIS_AREA_HEIGHT
OUString GetAbsoluteReference(const OUString &rValue) const
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
#define SAL_WARN_IF(condition, area, stream)
constexpr tools::Long Height() const
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:156
void setWidth(tools::Long n)
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
OUString aName
void Add(std::u16string_view rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:639
Reference< XComponentContext > getProcessComponentContext()
IMPRESS
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmltexti.cxx:181
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:134
virtual void RedlineAdjustStartNodeCursor() override
Definition: xmltexti.cxx:1005
void setHeight(tools::Long nHeight)
MapUnit
Reference< XSingleServiceFactory > xFactory
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void SetPosX(tools::Long x)
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3468
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1617
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:804
#define SO3_PLUGIN_CLASSID
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
#define SIZE_NOT_SET
void setHeight(tools::Long n)
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1319
OUString const & GetOpenRedlineId() const
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)