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/task/XInteractionHandler.hpp>
28 #include <o3tl/any.hxx>
29 #include <rtl/ustrbuf.hxx>
30 #include <sal/log.hxx>
31 #include <comphelper/classids.hxx>
32 #include <com/sun/star/lang/XUnoTunnel.hpp>
33 #include <xmloff/prstylei.hxx>
34 #include <xmloff/maptype.hxx>
35 #include <xmloff/xmlprmap.hxx>
36 #include <xmloff/txtprmap.hxx>
37 #include <xmloff/i18nmap.hxx>
38 #include <xmloff/xmlimppr.hxx>
39 #include <TextCursorHelper.hxx>
40 #include <unoframe.hxx>
41 #include <doc.hxx>
44 #include <fmtfsize.hxx>
45 #include <fmtanchr.hxx>
46 #include <fmtcntnt.hxx>
47 #include "xmlimp.hxx"
48 #include "xmltbli.hxx"
49 #include "xmltexti.hxx"
52 #include <SwAppletImpl.hxx>
53 #include <ndole.hxx>
54 #include <docsh.hxx>
55 #include <sfx2/docfile.hxx>
56 #include <vcl/svapp.hxx>
58 #include <svtools/embedhlp.hxx>
59 #include <svl/urihelper.hxx>
60 #include <sfx2/frmdescr.hxx>
61 #include <tools/globname.hxx>
62 
63 using namespace ::com::sun::star;
64 using namespace ::com::sun::star::uno;
65 using namespace ::com::sun::star::lang;
66 using namespace ::com::sun::star::text;
67 using namespace ::com::sun::star::frame;
68 using namespace ::com::sun::star::beans;
69 using namespace xml::sax;
70 
71 namespace {
72 
73 struct XMLServiceMapEntry_Impl
74 {
75  const char *sFilterService;
76  sal_Int32 const nFilterServiceLen;
77 
78  sal_uInt32 const n1;
79  sal_uInt16 n2, n3;
80  sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
81 };
82 
83 }
84 
85 #define SERVICE_MAP_ENTRY( app, s ) \
86  { XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1, \
87  SO3_##s##_CLASSID }
88 
89 const XMLServiceMapEntry_Impl aServiceMap[] =
90 {
92  SERVICE_MAP_ENTRY( CALC, SC ),
93  SERVICE_MAP_ENTRY( DRAW, SDRAW ),
94  SERVICE_MAP_ENTRY( IMPRESS, SIMPRESS ),
95  SERVICE_MAP_ENTRY( CHART, SCH ),
96  SERVICE_MAP_ENTRY( MATH, SM ),
97  { nullptr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
98 };
99 static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
100  sal_Int32 nHeight, sal_Int32 nWidth,
101  Size *pTwipSize = nullptr )
102 {
103  if( nWidth > 0 && nHeight > 0 )
104  {
105  nWidth = convertMm100ToTwip( nWidth );
106  if( nWidth < MINFLY )
107  nWidth = MINFLY;
108  nHeight = convertMm100ToTwip( nHeight );
109  if( nHeight < MINFLY )
110  nHeight = MINFLY;
111  rItemSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) );
112  }
113 
114  SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
115  rItemSet.Put( aAnchor );
116 
117  if( pTwipSize )
118  {
119  pTwipSize->setWidth( nWidth );
120  pTwipSize->setHeight( nHeight);
121  }
122 }
123 
124 static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
125  sal_Int64 nAspect,
126  const Size& aVisSize,
127  const MapUnit& aUnit )
128 {
129  if( xObj.is() && nAspect != embed::Aspects::MSOLE_ICON )
130  {
131  // convert the visual area to the objects units
132  MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
133  Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit));
134  awt::Size aSz;
135  aSz.Width = aObjVisSize.Width();
136  aSz.Height = aObjVisSize.Height();
137 
138  try
139  {
140  xObj->setVisualAreaSize( nAspect, aSz );
141  }
142  catch( uno::Exception& )
143  {
144  OSL_FAIL( "Couldn't set visual area of the object!" );
145  }
146  }
147 }
148 
150  const uno::Reference < XModel>& rModel,
151  SvXMLImport& rImport,
152  const uno::Reference<XPropertySet> & rInfoSet,
153  bool bInsertM, bool bStylesOnlyM,
154  bool bBlockM, bool bOrganizerM ) :
155  XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, true/*bProgress*/,
156  bBlockM, bOrganizerM ),
157  pRedlineHelper( nullptr )
158 {
159  uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
161  bInsertM || bBlockM, xDocPropSet, rInfoSet );
162 }
163 
165 {
166  // the redline helper destructor sets properties on the document
167  // and may throw an exception while doing so... catch this
168  try
169  {
170  delete pRedlineHelper;
171  }
172  catch ( const RuntimeException& )
173  {
174  // ignore
175  }
176 }
177 
179  SvXMLImport& rImport,
180  sal_uInt16 nPrefix, const OUString& rLocalName,
181  const uno::Reference< XAttributeList > & xAttrList )
182 {
183  return new SwXMLTableContext(
184  static_cast<SwXMLImport&>(rImport), nPrefix, rLocalName, xAttrList );
185 }
186 
188 {
189  uno::Reference<XUnoTunnel> xCursorTunnel(
190  const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY );
191  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
192  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
193  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
194  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
195  SwDoc *pDoc = pTextCursor ? pTextCursor->GetDoc() : nullptr;
196 
197  return pDoc && pDoc->IsInHeaderFooter( pTextCursor->GetPaM()->GetPoint()->nNode );
198 }
199 
200 static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat )
201 {
202  SwOLENode *pOLENd = nullptr;
203  if( pFrameFormat )
204  {
205  const SwFormatContent& rContent = pFrameFormat->GetContent();
206  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
207  pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
208  }
209  OSL_ENSURE( pOLENd, "Where is the OLE node" );
210  return pOLENd;
211 }
212 
213 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
214  SvXMLImport& rImport,
215  const OUString& rHRef,
216  const OUString& rStyleName,
217  const OUString& rTableName,
218  sal_Int32 nWidth, sal_Int32 nHeight )
219 {
220  // this method will modify the document directly -> lock SolarMutex
221  SolarMutexGuard aGuard;
222 
223  uno::Reference < XPropertySet > xPropSet;
224 
225  sal_Int32 nPos = rHRef.indexOf( ':' );
226  if( -1 == nPos )
227  return xPropSet;
228 
229  OUString aObjName( rHRef.copy( nPos+1) );
230 
231  if( aObjName.isEmpty() )
232  return xPropSet;
233 
234  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
235  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
236  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
237  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
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.setX( nVal );
480  }
481  break;
483  {
484  sal_Int32 nVal = 0;
485  rProp.maValue >>= nVal;
486  aVisArea.setY( 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 = reinterpret_cast< OTextCursorHelper * >(
549  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
550  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
551  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
552 
554  RES_FRMATR_END>{} );
555  Size aTwipSize( 0, 0 );
556  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
557  &aTwipSize );
558 
559  // We'll need a (valid) URL. If we don't have do not insert the link and return early.
560  // Copy URL into URL object on the way.
561  INetURLObject aURLObj;
562  bool bValidURL = !rHRef.isEmpty() &&
564  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
565  if( !bValidURL )
566  return xPropSet;
567 
568  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
569  try
570  {
571  // create object with desired ClassId
572  uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
573  embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
574 
575  uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
576  aMediaDescriptor[0].Name = "URL";
577  aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
578 
579  if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
580  {
581  uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
582  if ( xInteraction.is() )
583  {
584  aMediaDescriptor.realloc( 2 );
585  aMediaDescriptor[1].Name = "InteractionHandler";
586  aMediaDescriptor[1].Value <<= xInteraction;
587  }
588 
589  const auto nLen = aMediaDescriptor.getLength() + 1;
590  aMediaDescriptor.realloc(nLen);
591  aMediaDescriptor[nLen - 1].Name = "Referer";
592  aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
593  }
594 
595  uno::Reference < embed::XEmbeddedObject > xObj(
596  xFactory->createInstanceLink(
597  xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
598  uno::UNO_QUERY_THROW );
599 
600  {
601  SwFrameFormat *const pFrameFormat =
603  *pTextCursor->GetPaM(),
604  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
605  &aItemSet );
606 
607  // 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???
608 
610  *pDoc, pFrameFormat), uno::UNO_QUERY);
612  {
614  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
615  }
616  }
617  }
618  catch ( uno::Exception& )
619  {
620  }
621 
622  // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object?
623 
624  return xPropSet;
625 }
626 
627 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
628  const OUString &rName,
629  const OUString &rCode,
630  bool bMayScript,
631  const OUString& rHRef,
632  sal_Int32 nWidth, sal_Int32 nHeight )
633 {
634  // this method will modify the document directly -> lock SolarMutex
635  SolarMutexGuard aGuard;
636 
637  uno::Reference < XPropertySet > xPropSet;
638  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
639  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
640  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
641  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
642  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
643  SwDoc *pDoc = pTextCursor->GetDoc();
644 
646  RES_FRMATR_END>{} );
647  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
648 
649  SwApplet_Impl aAppletImpl ( aItemSet );
650 
651  OUString sCodeBase;
652  if( !rHRef.isEmpty() )
653  sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef );
654 
655  aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() );
656 
657  // set the size of the applet
658  lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
659  embed::Aspects::MSOLE_CONTENT,
660  Size( nWidth, nHeight ),
661  MapUnit::Map100thMM );
662 
663  SwFrameFormat *const pFrameFormat =
664  pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(),
665  ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT),
666  &aAppletImpl.GetItemSet());
668  *pDoc, pFrameFormat), uno::UNO_QUERY);
670  {
671  // req for z-order
672  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
673  }
674 
675  return xPropSet;
676 }
677 
678 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
679  const OUString &rMimeType,
680  const OUString& rHRef,
681  sal_Int32 nWidth, sal_Int32 nHeight )
682 {
683  uno::Reference < XPropertySet > xPropSet;
684  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
685  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
686  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
687  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
688  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
689  SwDoc *pDoc = pTextCursor->GetDoc();
690 
692  RES_FRMATR_END>{} );
693  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
694 
695  // We'll need a (valid) URL, or we need a MIME type. If we don't have
696  // either, do not insert plugin and return early. Copy URL into URL object
697  // on the way.
698  INetURLObject aURLObj;
699 
700  bool bValidURL = !rHRef.isEmpty() &&
701  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
702  bool bValidMimeType = !rMimeType.isEmpty();
703  if( !bValidURL && !bValidMimeType )
704  return xPropSet;
705 
706  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
707  try
708  {
709  // create object with desired ClassId
710  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
711  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
712  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
713  aClass, OUString(), xStorage, "DummyName",
714  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
715 
716  // set size to the object
718  embed::Aspects::MSOLE_CONTENT,
719  Size( nWidth, nHeight ),
720  MapUnit::Map100thMM );
721 
723  {
724  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
725  if ( xSet.is() )
726  {
727  if( bValidURL )
728  xSet->setPropertyValue("PluginURL",
730  if( bValidMimeType )
731  xSet->setPropertyValue("PluginMimeType",
732  makeAny( rMimeType ) );
733  }
734 
735  SwFrameFormat *const pFrameFormat =
737  *pTextCursor->GetPaM(),
738  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
739  &aItemSet);
741  *pDoc, pFrameFormat), uno::UNO_QUERY);
743  {
745  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
746  }
747  }
748  }
749  catch ( uno::Exception& )
750  {
751  }
752 
753  return xPropSet;
754 }
756  const OUString& rName,
757  const OUString& rHRef,
758  const OUString& rStyleName,
759  sal_Int32 nWidth, sal_Int32 nHeight )
760 {
761  // this method will modify the document directly -> lock SolarMutex
762  SolarMutexGuard aGuard;
763 
764  uno::Reference < XPropertySet > xPropSet;
765  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
766  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
767  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
768  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
769  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
770  SwDoc *pDoc = pTextCursor->GetDoc();
771 
773  RES_FRMATR_END>{} );
774  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
775 
776  ScrollingMode eScrollMode = ScrollingMode::Auto;
777  bool bHasBorder = false;
778  bool bIsBorderSet = false;
779  Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
780  const XMLPropStyleContext *pStyle = nullptr;
781  if( !rStyleName.isEmpty() )
782  {
783  pStyle = FindAutoFrameStyle( rStyleName );
784  if( pStyle )
785  {
787  pStyle->GetStyles()
788  ->GetImportPropertyMapper(pStyle->GetFamily());
789  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
790  if( xImpPrMap.is() )
791  {
793  xImpPrMap->getPropertySetMapper();
794 
795  sal_Int32 nCount = pStyle->GetProperties().size();
796  for( sal_Int32 i=0; i < nCount; i++ )
797  {
798  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
799  sal_Int32 nIdx = rProp.mnIndex;
800  if( -1 == nIdx )
801  continue;
802 
803  switch( rPropMapper->GetEntryContextId(nIdx) )
804  {
806  {
807  bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
808  eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
809  }
810  break;
812  {
813  bHasBorder = *o3tl::doAccess<bool>(rProp.maValue);
814  bIsBorderSet = true;
815  }
816  break;
818  {
819  sal_Int32 nVal = SIZE_NOT_SET;
820  rProp.maValue >>= nVal;
821  aMargin.setWidth( nVal );
822  }
823  break;
825  {
826  sal_Int32 nVal = SIZE_NOT_SET;
827  rProp.maValue >>= nVal;
828  aMargin.setHeight( nVal );
829  }
830  break;
831  }
832  }
833  }
834  }
835  }
836 
837  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
838  try
839  {
840  // create object with desired ClassId
841  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
842  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
843  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
844  aClass, OUString(), xStorage, "DummyName",
845  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
846 
847  // set size to the object
849  embed::Aspects::MSOLE_CONTENT,
850  Size( nWidth, nHeight ),
851  MapUnit::Map100thMM );
852 
854  {
855  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
856  if ( xSet.is() )
857  {
858  xSet->setPropertyValue("FrameURL",
860  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
861 
862  xSet->setPropertyValue("FrameName",
863  makeAny( rName ) );
864 
865  if ( eScrollMode == ScrollingMode::Auto )
866  xSet->setPropertyValue("FrameIsAutoScroll",
867  makeAny( true ) );
868  else
869  xSet->setPropertyValue("FrameIsScrollingMode",
870  makeAny( eScrollMode == ScrollingMode::Yes ) );
871 
872  if ( bIsBorderSet )
873  xSet->setPropertyValue("FrameIsBorder",
874  makeAny( bHasBorder ) );
875  else
876  xSet->setPropertyValue("FrameIsAutoBorder",
877  makeAny( true ) );
878 
879  xSet->setPropertyValue("FrameMarginWidth",
880  makeAny( sal_Int32( aMargin.Width() ) ) );
881 
882  xSet->setPropertyValue("FrameMarginHeight",
883  makeAny( sal_Int32( aMargin.Height() ) ) );
884  }
885 
886  SwFrameFormat *const pFrameFormat =
888  *pTextCursor->GetPaM(),
889  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
890  &aItemSet);
892  *pDoc, pFrameFormat), uno::UNO_QUERY);
894  {
895  // req for z-order
897  static_cast<SwFlyFrameFormat*>(pFrameFormat));
898  }
899  }
900  }
901  catch ( uno::Exception& )
902  {
903  }
904 
905  return xPropSet;
906 }
907 
909  const uno::Reference < XPropertySet > &rPropSet,
910  std::map < const OUString, OUString > &rParamMap)
911 {
912  // this method will modify the document directly -> lock SolarMutex
913  SolarMutexGuard aGuard;
914 
915  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
916  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
917  SwXFrame *pFrame = reinterpret_cast< SwXFrame * >(
918  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( SwXFrame::getUnoTunnelId() )));
919  OSL_ENSURE( pFrame, "SwXFrame missing" );
920  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
921  const SwFormatContent& rContent = pFrameFormat->GetContent();
922  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
923  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
924  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
925 
926  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
928  {
929  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
930  if ( xSet.is() )
931  {
932  const sal_Int32 nCount = rParamMap.size();
933  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
934 
935  sal_Int32 nIndex=0;
936  for (const auto& rParam : rParamMap )
937  {
938  aCommandSequence[nIndex].Name = rParam.first;
939  aCommandSequence[nIndex].Handle = -1;
940  aCommandSequence[nIndex].Value <<= rParam.second;
941  aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
942  ++nIndex;
943  }
944 
945  // unfortunately the names of the properties are depending on the object
946  OUString aParaName("AppletCommands");
947  try
948  {
949  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
950  }
951  catch ( uno::Exception& )
952  {
953  aParaName = "PluginCommands";
954  try
955  {
956  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
957  }
958  catch ( uno::Exception& )
959  {
960  }
961  }
962  }
963  }
964 }
965 
966 // redlining helper methods
967 // (override to provide the real implementation)
969  const OUString& rType,
970  const OUString& rId,
971  const OUString& rAuthor,
972  const OUString& rComment,
973  const util::DateTime& rDateTime,
974  bool bMergeLastPara)
975 {
976  // create redline helper on demand
977  OSL_ENSURE(nullptr != pRedlineHelper, "helper should have been created in constructor");
978  if (nullptr != pRedlineHelper)
979  pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
980  bMergeLastPara);
981 }
982 
983 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
984  uno::Reference<XTextCursor> & rOldCursor,
985  const OUString& rId)
986 {
987  uno::Reference<XTextCursor> xRet;
988 
989  if (nullptr != pRedlineHelper)
990  {
991  xRet = pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
992  }
993 
994  return xRet;
995 }
996 
998  const OUString& rId,
999  bool bStart,
1000  bool bIsOutsideOfParagraph)
1001 {
1002  if (nullptr != pRedlineHelper) {
1003  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
1004  pRedlineHelper->SetCursor(rId, bStart, xTextRange,
1005  bIsOutsideOfParagraph);
1006  }
1007  // else: ignore redline (wasn't added before, else we'd have a helper)
1008 }
1009 
1011 {
1012  OUString rId = GetOpenRedlineId();
1013  if ((nullptr != pRedlineHelper) && !rId.isEmpty())
1014  {
1017  }
1018  // else: ignore redline (wasn't added before, or no open redline ID
1019 }
1020 
1021 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
1022 {
1023  if ( nullptr != pRedlineHelper )
1024  pRedlineHelper->SetShowChanges( bShowChanges );
1025 }
1026 
1027 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
1028 {
1029  if ( nullptr != pRedlineHelper )
1030  pRedlineHelper->SetRecordChanges( bRecordChanges );
1031 }
1032 
1034  const Sequence<sal_Int8> & rKey )
1035 {
1036  if ( nullptr != pRedlineHelper )
1038 }
1039 
1040 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetApplet() const
#define SERVICE_MAP_ENTRY(app, s)
Definition: xmltexti.cxx:85
sal_Int32 nIndex
void setHeight(long n)
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:983
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:1027
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
SwDocShell * GetDocShell()
Definition: doc.hxx:1346
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
int n1
const ::std::vector< XMLPropertyState > & GetProperties() const
#define SO3_IFRAME_CLASSID
#define MINFLY
Definition: swtypes.hxx:65
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph) override
ID used to RedlineAdd() call.
Definition: xmltexti.cxx:997
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:912
#define RES_FRMATR_END
Definition: hintids.hxx:331
Definition: doc.hxx:185
#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()
void SetCursor(const OUString &rId, bool bStart, css::uno::Reference< css::text::XTextRange > const &rRange, bool bIsOusideOfParagraph)
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:314
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(sal_uInt16 nFamily) const
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1542
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:755
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
css::uno::Reference< css::embed::XStorage > const & GetStorage()
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:968
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
DRAW
void SetShowChanges(bool bShowChanges)
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:964
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:627
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)
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Definition: xmltexti.cxx:178
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:89
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)
void setWidth(long n)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:678
virtual void SetShowChanges(bool bShowChanges) override
Definition: xmltexti.cxx:1021
#define XML_TEXT_RENAME_TYPE_TABLE
sal_uInt16 GetFamily() const
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:213
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
Style of a layout element.
Definition: frmfmt.hxx:57
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, const SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
SvXMLImport & GetXMLImport()
void setY(long y)
MATH
int i
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:908
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1353
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:149
virtual bool IsInHeaderFooter() const override
Definition: xmltexti.cxx:187
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual ~SwXMLTextImportHelper() override
Definition: xmltexti.cxx:164
bool IsInsertMode() const
#define CTF_FRAME_DISPLAY_BORDER
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:200
static void lcl_setObjectVisualArea(const uno::Reference< embed::XEmbeddedObject > &xObj, sal_Int64 nAspect, const Size &aVisSize, const MapUnit &aUnit)
Definition: xmltexti.cxx:124
#define CTF_FRAME_MARGIN_VERT
Frame cannot be moved in Var-direction.
#define CTF_OLE_DRAW_ASPECT
Size GetSize() const
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey) override
Definition: xmltexti.cxx:1033
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
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)
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:99
#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)
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:156
void Add(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
OUString aName
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:612
Reference< XComponentContext > getProcessComponentContext()
IMPRESS
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:1010
MapUnit
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoframe.cxx:1163
Reference< XSingleServiceFactory > xFactory
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SVX_DLLPUBLIC MSO_SPT Get(const OUString &)
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:3445
void setX(long x)
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1695
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:801
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:287
#define SO3_PLUGIN_CLASSID
#define SIZE_NOT_SET
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1313
XMLRedlineImportHelper * pRedlineHelper
Definition: xmltexti.hxx:29
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)
void setHeight(long nHeight)
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)