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 <unocrsr.hxx>
40 #include <TextCursorHelper.hxx>
41 #include <unoframe.hxx>
42 #include <doc.hxx>
45 #include <unocoll.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 
65 using namespace ::com::sun::star;
66 using namespace ::com::sun::star::uno;
67 using namespace ::com::sun::star::lang;
68 using namespace ::com::sun::star::text;
69 using namespace ::com::sun::star::frame;
70 using namespace ::com::sun::star::beans;
71 using namespace xml::sax;
72 
74 {
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 #define SERVICE_MAP_ENTRY( app, s ) \
84  { XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1, \
85  SO3_##s##_CLASSID }
86 
88 {
90  SERVICE_MAP_ENTRY( CALC, SC ),
91  SERVICE_MAP_ENTRY( DRAW, SDRAW ),
92  SERVICE_MAP_ENTRY( IMPRESS, SIMPRESS ),
93  SERVICE_MAP_ENTRY( CHART, SCH ),
94  SERVICE_MAP_ENTRY( MATH, SM ),
95  { nullptr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
96 };
97 static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
98  sal_Int32 nHeight, sal_Int32 nWidth,
99  Size *pTwipSize = nullptr )
100 {
101  if( nWidth > 0 && nHeight > 0 )
102  {
103  nWidth = convertMm100ToTwip( nWidth );
104  if( nWidth < MINFLY )
105  nWidth = MINFLY;
106  nHeight = convertMm100ToTwip( nHeight );
107  if( nHeight < MINFLY )
108  nHeight = MINFLY;
109  rItemSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth, nHeight ) );
110  }
111 
112  SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
113  rItemSet.Put( aAnchor );
114 
115  if( pTwipSize )
116  {
117  pTwipSize->setWidth( nWidth );
118  pTwipSize->setHeight( nHeight);
119  }
120 }
121 
122 static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
123  sal_Int64 nAspect,
124  const Size& aVisSize,
125  const MapUnit& aUnit )
126 {
127  if( xObj.is() && nAspect != embed::Aspects::MSOLE_ICON )
128  {
129  // convert the visual area to the objects units
130  MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
131  Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit));
132  awt::Size aSz;
133  aSz.Width = aObjVisSize.Width();
134  aSz.Height = aObjVisSize.Height();
135 
136  try
137  {
138  xObj->setVisualAreaSize( nAspect, aSz );
139  }
140  catch( uno::Exception& )
141  {
142  OSL_FAIL( "Couldn't set visual area of the object!" );
143  }
144  }
145 }
146 
148  const uno::Reference < XModel>& rModel,
149  SvXMLImport& rImport,
150  const uno::Reference<XPropertySet> & rInfoSet,
151  bool bInsertM, bool bStylesOnlyM,
152  bool bBlockM, bool bOrganizerM ) :
153  XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, true/*bProgress*/,
154  bBlockM, bOrganizerM ),
155  pRedlineHelper( nullptr )
156 {
157  uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
159  bInsertM || bBlockM, xDocPropSet, rInfoSet );
160 }
161 
163 {
164  // the redline helper destructor sets properties on the document
165  // and may throw an exception while doing so... catch this
166  try
167  {
168  delete pRedlineHelper;
169  }
170  catch ( const RuntimeException& )
171  {
172  // ignore
173  }
174 }
175 
177  SvXMLImport& rImport,
178  sal_uInt16 nPrefix, const OUString& rLocalName,
179  const uno::Reference< XAttributeList > & xAttrList )
180 {
181  return new SwXMLTableContext(
182  static_cast<SwXMLImport&>(rImport), nPrefix, rLocalName, xAttrList );
183 }
184 
186 {
187  uno::Reference<XUnoTunnel> xCursorTunnel(
188  const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY );
189  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
190  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
191  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
192  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
193  SwDoc *pDoc = pTextCursor ? pTextCursor->GetDoc() : nullptr;
194 
195  return pDoc && pDoc->IsInHeaderFooter( pTextCursor->GetPaM()->GetPoint()->nNode );
196 }
197 
198 static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat )
199 {
200  SwOLENode *pOLENd = nullptr;
201  if( pFrameFormat )
202  {
203  const SwFormatContent& rContent = pFrameFormat->GetContent();
204  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
205  pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
206  }
207  OSL_ENSURE( pOLENd, "Where is the OLE node" );
208  return pOLENd;
209 }
210 
211 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
212  SvXMLImport& rImport,
213  const OUString& rHRef,
214  const OUString& rStyleName,
215  const OUString& rTableName,
216  sal_Int32 nWidth, sal_Int32 nHeight )
217 {
218  // this method will modify the document directly -> lock SolarMutex
219  SolarMutexGuard aGuard;
220 
221  uno::Reference < XPropertySet > xPropSet;
222 
223  sal_Int32 nPos = rHRef.indexOf( ':' );
224  if( -1 == nPos )
225  return xPropSet;
226 
227  OUString aObjName( rHRef.copy( nPos+1) );
228 
229  if( aObjName.isEmpty() )
230  return xPropSet;
231 
232  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
233  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
234  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
235  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
236  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
237  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
238 
240  RES_FRMATR_END>{} );
241  Size aTwipSize( 0, 0 );
242  tools::Rectangle aVisArea( 0, 0, nWidth, nHeight );
243  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
244  &aTwipSize );
245 
246  SwFrameFormat *pFrameFormat = nullptr;
247  SwOLENode *pOLENd = nullptr;
248  if( rHRef.startsWith("vnd.sun.star.ServiceName:") )
249  {
250  bool bInsert = false;
251  SvGlobalName aClassName;
252  const XMLServiceMapEntry_Impl *pEntry = aServiceMap;
253  while( pEntry->sFilterService )
254  {
255  if( aObjName.equalsAsciiL( pEntry->sFilterService,
256  pEntry->nFilterServiceLen ) )
257  {
258  aClassName = SvGlobalName( pEntry->n1, pEntry->n2,
259  pEntry->n3, pEntry->n4,
260  pEntry->n5, pEntry->n6,
261  pEntry->n7, pEntry->n8,
262  pEntry->n9, pEntry->n10,
263  pEntry->n11 );
264  bInsert = true;
265  break;
266  }
267  pEntry++;
268  }
269 
270  if( bInsert )
271  {
272  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
273  try
274  {
275  // create object with desired ClassId
276  uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
277  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
278  uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({
279  { "DefaultParentBaseURL", Any(GetXMLImport().GetBaseURL()) }
280  }));
281  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
282  aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
283  if ( xObj.is() )
284  {
285  //TODO/LATER: is it enough to only set the VisAreaSize?
286  lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
287  }
288 
289  if( pTextCursor )
290  {
291  pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
292  *pTextCursor->GetPaM(),
293  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
294  &aItemSet);
295  pOLENd = lcl_GetOLENode( pFrameFormat );
296  }
297 
298  if( pOLENd )
299  aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
300  }
301  catch ( uno::Exception& )
302  {
303  }
304  }
305  }
306  else
307  {
308  // check whether an object with this name already exists in the document
309  OUString aName;
311  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
312  {
313  SwOLENode* pExistingOLENd = pNd->GetOLENode();
314  if( pExistingOLENd )
315  {
316  OUString aExistingName = pExistingOLENd->GetOLEObj().GetCurrentPersistName();
317  if ( aExistingName == aObjName )
318  {
319  OSL_FAIL( "The document contains duplicate object references, means it is partially broken, please let developers know how this document was generated!" );
320 
321  OUString aTmpName = pDoc->GetPersist()->GetEmbeddedObjectContainer().CreateUniqueObjectName();
322  try
323  {
324  pDoc->GetPersist()->GetStorage()->copyElementTo( aObjName,
325  pDoc->GetPersist()->GetStorage(),
326  aTmpName );
327  aName = aTmpName;
328  }
329  catch ( uno::Exception& )
330  {
331  OSL_FAIL( "Couldn't create a copy of the object!" );
332  }
333 
334  break;
335  }
336  }
337  }
338 
339  if ( aName.isEmpty() )
340  aName = aObjName;
341 
342  // the correct aspect will be set later
343  // TODO/LATER: Actually it should be set here
344  if( pTextCursor )
345  {
346  pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCursor->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr );
347  pOLENd = lcl_GetOLENode( pFrameFormat );
348  }
349  aObjName = aName;
350  }
351 
352  if( !pFrameFormat )
353  return xPropSet;
354 
355  if( IsInsertMode() )
356  {
357  if( !pOLENd )
358  pOLENd = lcl_GetOLENode( pFrameFormat );
359  if( pOLENd )
360  pOLENd->SetOLESizeInvalid( true );
361  }
362 
364  *pDoc, pFrameFormat), uno::UNO_QUERY);
366  {
367  // req for z-order
368  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
369  }
370  if( !rTableName.isEmpty() )
371  {
372  const SwFormatContent& rContent = pFrameFormat->GetContent();
373  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
374  SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
375  OSL_ENSURE( pOLENode, "Where is the OLE node" );
376 
377  OUStringBuffer aBuffer( rTableName.getLength() );
378  bool bQuoted = false;
379  bool bEscape = false;
380  bool bError = false;
381  for( sal_Int32 i=0; i < rTableName.getLength(); i++ )
382  {
383  bool bEndOfNameFound = false;
384  sal_Unicode c = rTableName[i];
385  switch( c )
386  {
387  case '\'':
388  if( bEscape )
389  {
390  aBuffer.append( c );
391  bEscape = false;
392  }
393  else if( bQuoted )
394  {
395  bEndOfNameFound = true;
396  }
397  else if( 0 == i )
398  {
399  bQuoted = true;
400  }
401  else
402  {
403  bError = true;
404  }
405  break;
406  case '\\':
407  if( bEscape )
408  {
409  aBuffer.append( c );
410  bEscape = false;
411  }
412  else
413  {
414  bEscape = true;
415  }
416  break;
417  case ' ':
418  case '.':
419  if( !bQuoted )
420  {
421  bEndOfNameFound = true;
422  }
423  else
424  {
425  aBuffer.append( c );
426  bEscape = false;
427  }
428  break;
429  default:
430  {
431  aBuffer.append( c );
432  bEscape = false;
433  }
434  break;
435  }
436  if( bError || bEndOfNameFound )
437  break;
438  }
439  if( !bError )
440  {
441  OUString sTableName( aBuffer.makeStringAndClear() );
442  pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) );
443  }
444  }
445 
446  sal_Int64 nDrawAspect = 0;
447  const XMLPropStyleContext *pStyle = nullptr;
448  bool bHasSizeProps = false;
449  if( !rStyleName.isEmpty() )
450  {
451  pStyle = FindAutoFrameStyle( rStyleName );
452  if( pStyle )
453  {
455  pStyle->GetStyles()
456  ->GetImportPropertyMapper(pStyle->GetFamily());
457  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
458  if( xImpPrMap.is() )
459  {
461  xImpPrMap->getPropertySetMapper();
462 
463  sal_Int32 nCount = pStyle->GetProperties().size();
464  for( sal_Int32 i=0; i < nCount; i++ )
465  {
466  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
467  sal_Int32 nIdx = rProp.mnIndex;
468  if( -1 == nIdx )
469  continue;
470 
471  switch( rPropMapper->GetEntryContextId(nIdx) )
472  {
474  {
475  sal_Int32 nVal = 0;
476  rProp.maValue >>= nVal;
477  aVisArea.setX( nVal );
478  }
479  break;
481  {
482  sal_Int32 nVal = 0;
483  rProp.maValue >>= nVal;
484  aVisArea.setY( nVal );
485  }
486  break;
488  {
489  sal_Int32 nVal = 0;
490  rProp.maValue >>= nVal;
491  aVisArea.setWidth( nVal );
492  bHasSizeProps = true;
493  }
494  break;
496  {
497  sal_Int32 nVal = 0;
498  rProp.maValue >>= nVal;
499  aVisArea.setHeight( nVal );
500  bHasSizeProps = true;
501  }
502  break;
503  case CTF_OLE_DRAW_ASPECT:
504  {
505  rProp.maValue >>= nDrawAspect;
506 
507  if ( !nDrawAspect )
508  nDrawAspect = embed::Aspects::MSOLE_CONTENT;
509 
510  if ( pOLENd )
511  pOLENd->GetOLEObj().GetObject().SetViewAspect( nDrawAspect );
512  }
513  break;
514  }
515  }
516  }
517  }
518  }
519 
520  if ( bHasSizeProps )
521  {
522  uno::Reference < embed::XEmbeddedObject > xObj =
524  if( xObj.is() )
525  lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
526  aVisArea.GetSize(), MapUnit::Map100thMM );
527  }
528 
529  return xPropSet;
530 }
531 
532 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
533  SvXMLImport& rImport,
534  const OUString& rHRef,
535  const OUString& /*rStyleName*/,
536  const OUString& /*rTableName*/,
537  sal_Int32 nWidth, sal_Int32 nHeight )
538 {
539  // this method will modify the document directly -> lock SolarMutex
540  SolarMutexGuard aGuard;
541 
542  uno::Reference < XPropertySet > xPropSet;
543 
544  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
545  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
546  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
547  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
548  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
549  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
550 
552  RES_FRMATR_END>{} );
553  Size aTwipSize( 0, 0 );
554  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
555  &aTwipSize );
556 
557  // We'll need a (valid) URL. If we don't have do not insert the link and return early.
558  // Copy URL into URL object on the way.
559  INetURLObject aURLObj;
560  bool bValidURL = !rHRef.isEmpty() &&
562  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
563  if( !bValidURL )
564  return xPropSet;
565 
566  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
567  try
568  {
569  // create object with desired ClassId
570  uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
571  embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
572 
573  uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
574  aMediaDescriptor[0].Name = "URL";
575  aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
576 
577  if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
578  {
579  uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
580  if ( xInteraction.is() )
581  {
582  aMediaDescriptor.realloc( 2 );
583  aMediaDescriptor[1].Name = "InteractionHandler";
584  aMediaDescriptor[1].Value <<= xInteraction;
585  }
586 
587  const auto nLen = aMediaDescriptor.getLength() + 1;
588  aMediaDescriptor.realloc(nLen);
589  aMediaDescriptor[nLen - 1].Name = "Referer";
590  aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
591  }
592 
593  uno::Reference < embed::XEmbeddedObject > xObj(
594  xFactory->createInstanceLink(
595  xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
596  uno::UNO_QUERY_THROW );
597 
598  {
599  SwFrameFormat *const pFrameFormat =
601  *pTextCursor->GetPaM(),
602  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
603  &aItemSet );
604 
605  // 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???
606 
608  *pDoc, pFrameFormat), uno::UNO_QUERY);
610  {
612  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
613  }
614  }
615  }
616  catch ( uno::Exception& )
617  {
618  }
619 
620  // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object?
621 
622  return xPropSet;
623 }
624 
625 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
626  const OUString &rName,
627  const OUString &rCode,
628  bool bMayScript,
629  const OUString& rHRef,
630  sal_Int32 nWidth, sal_Int32 nHeight )
631 {
632  // this method will modify the document directly -> lock SolarMutex
633  SolarMutexGuard aGuard;
634 
635  uno::Reference < XPropertySet > xPropSet;
636  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
637  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
638  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
639  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
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 = reinterpret_cast< OTextCursorHelper * >(
685  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
686  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
687  SwDoc *pDoc = pTextCursor->GetDoc();
688 
690  RES_FRMATR_END>{} );
691  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
692 
693  // We'll need a (valid) URL, or we need a MIME type. If we don't have
694  // either, do not insert plugin and return early. Copy URL into URL object
695  // on the way.
696  INetURLObject aURLObj;
697 
698  bool bValidURL = !rHRef.isEmpty() &&
699  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
700  bool bValidMimeType = !rMimeType.isEmpty();
701  if( !bValidURL && !bValidMimeType )
702  return xPropSet;
703 
704  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
705  try
706  {
707  // create object with desired ClassId
708  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
709  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
710  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
711  aClass, OUString(), xStorage, "DummyName",
712  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
713 
714  // set size to the object
716  embed::Aspects::MSOLE_CONTENT,
717  Size( nWidth, nHeight ),
718  MapUnit::Map100thMM );
719 
721  {
722  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
723  if ( xSet.is() )
724  {
725  if( bValidURL )
726  xSet->setPropertyValue("PluginURL",
728  if( bValidMimeType )
729  xSet->setPropertyValue("PluginMimeType",
730  makeAny( rMimeType ) );
731  }
732 
733  SwFrameFormat *const pFrameFormat =
735  *pTextCursor->GetPaM(),
736  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
737  &aItemSet);
739  *pDoc, pFrameFormat), uno::UNO_QUERY);
741  {
743  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
744  }
745  }
746  }
747  catch ( uno::Exception& )
748  {
749  }
750 
751  return xPropSet;
752 }
754  const OUString& rName,
755  const OUString& rHRef,
756  const OUString& rStyleName,
757  sal_Int32 nWidth, sal_Int32 nHeight )
758 {
759  // this method will modify the document directly -> lock SolarMutex
760  SolarMutexGuard aGuard;
761 
762  uno::Reference < XPropertySet > xPropSet;
763  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
764  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
765  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
766  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
767  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
768  SwDoc *pDoc = pTextCursor->GetDoc();
769 
771  RES_FRMATR_END>{} );
772  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
773 
774  ScrollingMode eScrollMode = ScrollingMode::Auto;
775  bool bHasBorder = false;
776  bool bIsBorderSet = false;
777  Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
778  const XMLPropStyleContext *pStyle = nullptr;
779  if( !rStyleName.isEmpty() )
780  {
781  pStyle = FindAutoFrameStyle( rStyleName );
782  if( pStyle )
783  {
785  pStyle->GetStyles()
786  ->GetImportPropertyMapper(pStyle->GetFamily());
787  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
788  if( xImpPrMap.is() )
789  {
791  xImpPrMap->getPropertySetMapper();
792 
793  sal_Int32 nCount = pStyle->GetProperties().size();
794  for( sal_Int32 i=0; i < nCount; i++ )
795  {
796  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
797  sal_Int32 nIdx = rProp.mnIndex;
798  if( -1 == nIdx )
799  continue;
800 
801  switch( rPropMapper->GetEntryContextId(nIdx) )
802  {
804  {
805  bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
806  eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
807  }
808  break;
810  {
811  bHasBorder = *o3tl::doAccess<bool>(rProp.maValue);
812  bIsBorderSet = true;
813  }
814  break;
816  {
817  sal_Int32 nVal = SIZE_NOT_SET;
818  rProp.maValue >>= nVal;
819  aMargin.setWidth( nVal );
820  }
821  break;
823  {
824  sal_Int32 nVal = SIZE_NOT_SET;
825  rProp.maValue >>= nVal;
826  aMargin.setHeight( nVal );
827  }
828  break;
829  }
830  }
831  }
832  }
833  }
834 
835  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
836  try
837  {
838  // create object with desired ClassId
839  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
840  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
841  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
842  aClass, OUString(), xStorage, "DummyName",
843  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
844 
845  // set size to the object
847  embed::Aspects::MSOLE_CONTENT,
848  Size( nWidth, nHeight ),
849  MapUnit::Map100thMM );
850 
852  {
853  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
854  if ( xSet.is() )
855  {
856  xSet->setPropertyValue("FrameURL",
858  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
859 
860  xSet->setPropertyValue("FrameName",
861  makeAny( rName ) );
862 
863  if ( eScrollMode == ScrollingMode::Auto )
864  xSet->setPropertyValue("FrameIsAutoScroll",
865  makeAny( true ) );
866  else
867  xSet->setPropertyValue("FrameIsScrollingMode",
868  makeAny( eScrollMode == ScrollingMode::Yes ) );
869 
870  if ( bIsBorderSet )
871  xSet->setPropertyValue("FrameIsBorder",
872  makeAny( bHasBorder ) );
873  else
874  xSet->setPropertyValue("FrameIsAutoBorder",
875  makeAny( true ) );
876 
877  xSet->setPropertyValue("FrameMarginWidth",
878  makeAny( sal_Int32( aMargin.Width() ) ) );
879 
880  xSet->setPropertyValue("FrameMarginHeight",
881  makeAny( sal_Int32( aMargin.Height() ) ) );
882  }
883 
884  SwFrameFormat *const pFrameFormat =
886  *pTextCursor->GetPaM(),
887  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
888  &aItemSet);
890  *pDoc, pFrameFormat), uno::UNO_QUERY);
892  {
893  // req for z-order
895  static_cast<SwFlyFrameFormat*>(pFrameFormat));
896  }
897  }
898  }
899  catch ( uno::Exception& )
900  {
901  }
902 
903  return xPropSet;
904 }
905 
907  const uno::Reference < XPropertySet > &rPropSet,
908  std::map < const OUString, OUString > &rParamMap)
909 {
910  // this method will modify the document directly -> lock SolarMutex
911  SolarMutexGuard aGuard;
912 
913  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
914  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
915  SwXFrame *pFrame = reinterpret_cast< SwXFrame * >(
916  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( SwXFrame::getUnoTunnelId() )));
917  OSL_ENSURE( pFrame, "SwXFrame missing" );
918  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
919  const SwFormatContent& rContent = pFrameFormat->GetContent();
920  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
921  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
922  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
923 
924  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
926  {
927  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
928  if ( xSet.is() )
929  {
930  const sal_Int32 nCount = rParamMap.size();
931  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
932 
933  sal_Int32 nIndex=0;
934  for (const auto& rParam : rParamMap )
935  {
936  aCommandSequence[nIndex].Name = rParam.first;
937  aCommandSequence[nIndex].Handle = -1;
938  aCommandSequence[nIndex].Value <<= rParam.second;
939  aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
940  ++nIndex;
941  }
942 
943  // unfortunately the names of the properties are depending on the object
944  OUString aParaName("AppletCommands");
945  try
946  {
947  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
948  }
949  catch ( uno::Exception& )
950  {
951  aParaName = "PluginCommands";
952  try
953  {
954  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
955  }
956  catch ( uno::Exception& )
957  {
958  }
959  }
960  }
961  }
962 }
963 
964 // redlining helper methods
965 // (override to provide the real implementation)
967  const OUString& rType,
968  const OUString& rId,
969  const OUString& rAuthor,
970  const OUString& rComment,
971  const util::DateTime& rDateTime,
972  bool bMergeLastPara)
973 {
974  // create redline helper on demand
975  OSL_ENSURE(nullptr != pRedlineHelper, "helper should have been created in constructor");
976  if (nullptr != pRedlineHelper)
977  pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
978  bMergeLastPara);
979 }
980 
981 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
982  uno::Reference<XTextCursor> & rOldCursor,
983  const OUString& rId)
984 {
985  uno::Reference<XTextCursor> xRet;
986 
987  if (nullptr != pRedlineHelper)
988  {
989  xRet = pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
990  }
991 
992  return xRet;
993 }
994 
996  const OUString& rId,
997  bool bStart,
998  bool bIsOutsideOfParagraph)
999 {
1000  if (nullptr != pRedlineHelper) {
1001  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
1002  pRedlineHelper->SetCursor(rId, bStart, xTextRange,
1003  bIsOutsideOfParagraph);
1004  }
1005  // else: ignore redline (wasn't added before, else we'd have a helper)
1006 }
1007 
1009 {
1010  OUString rId = GetOpenRedlineId();
1011  if ((nullptr != pRedlineHelper) && !rId.isEmpty())
1012  {
1015  }
1016  // else: ignore redline (wasn't added before, or no open redline ID
1017 }
1018 
1019 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
1020 {
1021  if ( nullptr != pRedlineHelper )
1022  pRedlineHelper->SetShowChanges( bShowChanges );
1023 }
1024 
1025 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
1026 {
1027  if ( nullptr != pRedlineHelper )
1028  pRedlineHelper->SetRecordChanges( bRecordChanges );
1029 }
1030 
1032  const Sequence<sal_Int8> & rKey )
1033 {
1034  if ( nullptr != pRedlineHelper )
1036 }
1037 
1038 /* 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:83
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:981
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:1025
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
SwDocShell * GetDocShell()
Definition: doc.hxx:1342
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
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:995
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:913
#define RES_FRMATR_END
Definition: hintids.hxx:238
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
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
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:532
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:753
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
css::uno::Reference< css::embed::XStorage > const & GetStorage()
void SetRecordChanges(bool bRecordChanges)
sal_uInt16 sal_Unicode
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:966
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
DRAW
void SetShowChanges(bool bShowChanges)
char sal_Char
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:965
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:625
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:176
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:87
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)
sal_Int32 const nFilterServiceLen
Definition: xmltexti.cxx:76
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:1019
#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:211
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
sal_uInt32 const n1
Definition: xmltexti.cxx:78
const sal_Char * sFilterService
Definition: xmltexti.cxx:75
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:906
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1366
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:147
virtual bool IsInHeaderFooter() const override
Definition: xmltexti.cxx:185
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual ~SwXMLTextImportHelper() override
Definition: xmltexti.cxx:162
bool IsInsertMode() const
#define CTF_FRAME_DISPLAY_BORDER
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:198
static void lcl_setObjectVisualArea(const uno::Reference< embed::XEmbeddedObject > &xObj, sal_Int64 nAspect, const Size &aVisSize, const MapUnit &aUnit)
Definition: xmltexti.cxx:122
#define CTF_FRAME_MARGIN_VERT
#define CTF_OLE_DRAW_ASPECT
Size GetSize() const
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey) override
Definition: xmltexti.cxx:1031
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
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:97
#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
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:611
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:1008
OString const aName
MapUnit
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoframe.cxx:1168
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:3458
void setX(long x)
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1711
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:800
sal_Int32 nPos
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:194
#define SO3_PLUGIN_CLASSID
#define SIZE_NOT_SET
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
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)