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 <calbck.hxx>
59 #include <vcl/svapp.hxx>
61 #include <svtools/embedhlp.hxx>
62 #include <svl/urihelper.hxx>
63 #include <sfx2/frmdescr.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 =
282  uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
283  aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
284  if ( xObj.is() )
285  {
286  //TODO/LATER: is it enough to only set the VisAreaSize?
287  lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
288  }
289 
290  if( pTextCursor )
291  {
292  pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
293  *pTextCursor->GetPaM(),
294  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
295  &aItemSet);
296  pOLENd = lcl_GetOLENode( pFrameFormat );
297  }
298 
299  if( pOLENd )
300  aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
301  }
302  catch ( uno::Exception& )
303  {
304  }
305  }
306  }
307  else
308  {
309  // check whether an object with this name already exists in the document
310  OUString aName;
312  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
313  {
314  SwOLENode* pExistingOLENd = pNd->GetOLENode();
315  if( pExistingOLENd )
316  {
317  OUString aExistingName = pExistingOLENd->GetOLEObj().GetCurrentPersistName();
318  if ( aExistingName == aObjName )
319  {
320  OSL_FAIL( "The document contains duplicate object references, means it is partially broken, please let developers know how this document was generated!" );
321 
322  OUString aTmpName = pDoc->GetPersist()->GetEmbeddedObjectContainer().CreateUniqueObjectName();
323  try
324  {
325  pDoc->GetPersist()->GetStorage()->copyElementTo( aObjName,
326  pDoc->GetPersist()->GetStorage(),
327  aTmpName );
328  aName = aTmpName;
329  }
330  catch ( uno::Exception& )
331  {
332  OSL_FAIL( "Couldn't create a copy of the object!" );
333  }
334 
335  break;
336  }
337  }
338  }
339 
340  if ( aName.isEmpty() )
341  aName = aObjName;
342 
343  // the correct aspect will be set later
344  // TODO/LATER: Actually it should be set here
345  if( pTextCursor )
346  {
347  pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCursor->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr );
348  pOLENd = lcl_GetOLENode( pFrameFormat );
349  }
350  aObjName = aName;
351  }
352 
353  if( !pFrameFormat )
354  return xPropSet;
355 
356  if( IsInsertMode() )
357  {
358  if( !pOLENd )
359  pOLENd = lcl_GetOLENode( pFrameFormat );
360  if( pOLENd )
361  pOLENd->SetOLESizeInvalid( true );
362  }
363 
365  *pDoc, pFrameFormat), uno::UNO_QUERY);
367  {
368  // req for z-order
369  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
370  }
371  if( !rTableName.isEmpty() )
372  {
373  const SwFormatContent& rContent = pFrameFormat->GetContent();
374  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
375  SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
376  OSL_ENSURE( pOLENode, "Where is the OLE node" );
377 
378  OUStringBuffer aBuffer( rTableName.getLength() );
379  bool bQuoted = false;
380  bool bEscape = false;
381  bool bError = false;
382  for( sal_Int32 i=0; i < rTableName.getLength(); i++ )
383  {
384  bool bEndOfNameFound = false;
385  sal_Unicode c = rTableName[i];
386  switch( c )
387  {
388  case '\'':
389  if( bEscape )
390  {
391  aBuffer.append( c );
392  bEscape = false;
393  }
394  else if( bQuoted )
395  {
396  bEndOfNameFound = true;
397  }
398  else if( 0 == i )
399  {
400  bQuoted = true;
401  }
402  else
403  {
404  bError = true;
405  }
406  break;
407  case '\\':
408  if( bEscape )
409  {
410  aBuffer.append( c );
411  bEscape = false;
412  }
413  else
414  {
415  bEscape = true;
416  }
417  break;
418  case ' ':
419  case '.':
420  if( !bQuoted )
421  {
422  bEndOfNameFound = true;
423  }
424  else
425  {
426  aBuffer.append( c );
427  bEscape = false;
428  }
429  break;
430  default:
431  {
432  aBuffer.append( c );
433  bEscape = false;
434  }
435  break;
436  }
437  if( bError || bEndOfNameFound )
438  break;
439  }
440  if( !bError )
441  {
442  OUString sTableName( aBuffer.makeStringAndClear() );
443  pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) );
444  }
445  }
446 
447  sal_Int64 nDrawAspect = 0;
448  const XMLPropStyleContext *pStyle = nullptr;
449  bool bHasSizeProps = false;
450  if( !rStyleName.isEmpty() )
451  {
452  pStyle = FindAutoFrameStyle( rStyleName );
453  if( pStyle )
454  {
456  pStyle->GetStyles()
457  ->GetImportPropertyMapper(pStyle->GetFamily());
458  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
459  if( xImpPrMap.is() )
460  {
462  xImpPrMap->getPropertySetMapper();
463 
464  sal_Int32 nCount = pStyle->GetProperties().size();
465  for( sal_Int32 i=0; i < nCount; i++ )
466  {
467  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
468  sal_Int32 nIdx = rProp.mnIndex;
469  if( -1 == nIdx )
470  continue;
471 
472  switch( rPropMapper->GetEntryContextId(nIdx) )
473  {
475  {
476  sal_Int32 nVal = 0;
477  rProp.maValue >>= nVal;
478  aVisArea.setX( nVal );
479  }
480  break;
482  {
483  sal_Int32 nVal = 0;
484  rProp.maValue >>= nVal;
485  aVisArea.setY( nVal );
486  }
487  break;
489  {
490  sal_Int32 nVal = 0;
491  rProp.maValue >>= nVal;
492  aVisArea.setWidth( nVal );
493  bHasSizeProps = true;
494  }
495  break;
497  {
498  sal_Int32 nVal = 0;
499  rProp.maValue >>= nVal;
500  aVisArea.setHeight( nVal );
501  bHasSizeProps = true;
502  }
503  break;
504  case CTF_OLE_DRAW_ASPECT:
505  {
506  rProp.maValue >>= nDrawAspect;
507 
508  if ( !nDrawAspect )
509  nDrawAspect = embed::Aspects::MSOLE_CONTENT;
510 
511  if ( pOLENd )
512  pOLENd->GetOLEObj().GetObject().SetViewAspect( nDrawAspect );
513  }
514  break;
515  }
516  }
517  }
518  }
519  }
520 
521  if ( bHasSizeProps )
522  {
523  uno::Reference < embed::XEmbeddedObject > xObj =
525  if( xObj.is() )
526  lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
527  aVisArea.GetSize(), MapUnit::Map100thMM );
528  }
529 
530  return xPropSet;
531 }
532 
533 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
534  SvXMLImport& rImport,
535  const OUString& rHRef,
536  const OUString& /*rStyleName*/,
537  const OUString& /*rTableName*/,
538  sal_Int32 nWidth, sal_Int32 nHeight )
539 {
540  // this method will modify the document directly -> lock SolarMutex
541  SolarMutexGuard aGuard;
542 
543  uno::Reference < XPropertySet > xPropSet;
544 
545  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
546  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
547  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
548  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
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 = reinterpret_cast< OTextCursorHelper * >(
640  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
641  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
642  SwDoc *pDoc = pTextCursor->GetDoc();
643 
645  RES_FRMATR_END>{} );
646  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
647 
648  SwApplet_Impl aAppletImpl ( aItemSet );
649 
650  OUString sCodeBase;
651  if( !rHRef.isEmpty() )
652  sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef );
653 
654  aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() );
655 
656  // set the size of the applet
657  lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
658  embed::Aspects::MSOLE_CONTENT,
659  Size( nWidth, nHeight ),
660  MapUnit::Map100thMM );
661 
662  SwFrameFormat *const pFrameFormat =
663  pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(),
664  ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT),
665  &aAppletImpl.GetItemSet());
667  *pDoc, pFrameFormat), uno::UNO_QUERY);
669  {
670  // req for z-order
671  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
672  }
673 
674  return xPropSet;
675 }
676 
677 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
678  const OUString &rMimeType,
679  const OUString& rHRef,
680  sal_Int32 nWidth, sal_Int32 nHeight )
681 {
682  uno::Reference < XPropertySet > xPropSet;
683  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
684  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
685  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
686  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
687  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
688  SwDoc *pDoc = pTextCursor->GetDoc();
689 
691  RES_FRMATR_END>{} );
692  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
693 
694  // We'll need a (valid) URL, or we need a MIME type. If we don't have
695  // either, do not insert plugin and return early. Copy URL into URL object
696  // on the way.
697  INetURLObject aURLObj;
698 
699  bool bValidURL = !rHRef.isEmpty() &&
700  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
701  bool bValidMimeType = !rMimeType.isEmpty();
702  if( !bValidURL && !bValidMimeType )
703  return xPropSet;
704 
705  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
706  try
707  {
708  // create object with desired ClassId
709  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
710  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
711  uno::Reference < embed::XEmbeddedObject > xObj =
712  uno::Reference < embed::XEmbeddedObject >( 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 =
844  uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
845  aClass, OUString(), xStorage, "DummyName",
846  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
847 
848  // set size to the object
850  embed::Aspects::MSOLE_CONTENT,
851  Size( nWidth, nHeight ),
852  MapUnit::Map100thMM );
853 
855  {
856  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
857  if ( xSet.is() )
858  {
859  xSet->setPropertyValue("FrameURL",
861  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
862 
863  xSet->setPropertyValue("FrameName",
864  makeAny( rName ) );
865 
866  if ( eScrollMode == ScrollingMode::Auto )
867  xSet->setPropertyValue("FrameIsAutoScroll",
868  makeAny( true ) );
869  else
870  xSet->setPropertyValue("FrameIsScrollingMode",
871  makeAny( eScrollMode == ScrollingMode::Yes ) );
872 
873  if ( bIsBorderSet )
874  xSet->setPropertyValue("FrameIsBorder",
875  makeAny( bHasBorder ) );
876  else
877  xSet->setPropertyValue("FrameIsAutoBorder",
878  makeAny( true ) );
879 
880  xSet->setPropertyValue("FrameMarginWidth",
881  makeAny( sal_Int32( aMargin.Width() ) ) );
882 
883  xSet->setPropertyValue("FrameMarginHeight",
884  makeAny( sal_Int32( aMargin.Height() ) ) );
885  }
886 
887  SwFrameFormat *const pFrameFormat =
889  *pTextCursor->GetPaM(),
890  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
891  &aItemSet);
893  *pDoc, pFrameFormat), uno::UNO_QUERY);
895  {
896  // req for z-order
898  static_cast<SwFlyFrameFormat*>(pFrameFormat));
899  }
900  }
901  }
902  catch ( uno::Exception& )
903  {
904  }
905 
906  return xPropSet;
907 }
908 
910  const uno::Reference < XPropertySet > &rPropSet,
911  std::map < const OUString, OUString > &rParamMap)
912 {
913  // this method will modify the document directly -> lock SolarMutex
914  SolarMutexGuard aGuard;
915 
916  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
917  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
918  SwXFrame *pFrame = reinterpret_cast< SwXFrame * >(
919  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( SwXFrame::getUnoTunnelId() )));
920  OSL_ENSURE( pFrame, "SwXFrame missing" );
921  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
922  const SwFormatContent& rContent = pFrameFormat->GetContent();
923  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
924  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
925  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
926 
927  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
929  {
930  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
931  if ( xSet.is() )
932  {
933  const sal_Int32 nCount = rParamMap.size();
934  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
935 
936  sal_Int32 nIndex=0;
937  for (const auto& rParam : rParamMap )
938  {
939  aCommandSequence[nIndex].Name = rParam.first;
940  aCommandSequence[nIndex].Handle = -1;
941  aCommandSequence[nIndex].Value <<= rParam.second;
942  aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
943  ++nIndex;
944  }
945 
946  // unfortunately the names of the properties are depending on the object
947  OUString aParaName("AppletCommands");
948  try
949  {
950  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
951  }
952  catch ( uno::Exception& )
953  {
954  aParaName = "PluginCommands";
955  try
956  {
957  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
958  }
959  catch ( uno::Exception& )
960  {
961  }
962  }
963  }
964  }
965 }
966 
967 // redlining helper methods
968 // (override to provide the real implementation)
970  const OUString& rType,
971  const OUString& rId,
972  const OUString& rAuthor,
973  const OUString& rComment,
974  const util::DateTime& rDateTime,
975  bool bMergeLastPara)
976 {
977  // create redline helper on demand
978  OSL_ENSURE(nullptr != pRedlineHelper, "helper should have been created in constructor");
979  if (nullptr != pRedlineHelper)
980  pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
981  bMergeLastPara);
982 }
983 
984 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
985  uno::Reference<XTextCursor> & rOldCursor,
986  const OUString& rId)
987 {
988  uno::Reference<XTextCursor> xRet;
989 
990  if (nullptr != pRedlineHelper)
991  {
992  xRet = pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
993  }
994 
995  return xRet;
996 }
997 
999  const OUString& rId,
1000  bool bStart,
1001  bool bIsOutsideOfParagraph)
1002 {
1003  if (nullptr != pRedlineHelper) {
1004  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
1005  pRedlineHelper->SetCursor(rId, bStart, xTextRange,
1006  bIsOutsideOfParagraph);
1007  }
1008  // else: ignore redline (wasn't added before, else we'd have a helper)
1009 }
1010 
1012  bool /*bStart*/)
1013 {
1014  OUString rId = GetOpenRedlineId();
1015  if ((nullptr != pRedlineHelper) && !rId.isEmpty())
1016  {
1019  }
1020  // else: ignore redline (wasn't added before, or no open redline ID
1021 }
1022 
1023 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
1024 {
1025  if ( nullptr != pRedlineHelper )
1026  pRedlineHelper->SetShowChanges( bShowChanges );
1027 }
1028 
1029 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
1030 {
1031  if ( nullptr != pRedlineHelper )
1032  pRedlineHelper->SetRecordChanges( bRecordChanges );
1033 }
1034 
1036  const Sequence<sal_Int8> & rKey )
1037 {
1038  if ( nullptr != pRedlineHelper )
1040 }
1041 
1042 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() 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:984
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:1029
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:157
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:110
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetApplet()
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:998
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:900
#define RES_FRMATR_END
Definition: hintids.hxx:236
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:347
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:1555
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:533
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:187
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:969
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
DRAW
void SetShowChanges(bool bShowChanges)
char sal_Char
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:952
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
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
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
virtual void RedlineAdjustStartNodeCursor(bool bStart) override
Definition: xmltexti.cxx:1011
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:677
virtual void SetShowChanges(bool bShowChanges) override
Definition: xmltexti.cxx:1023
#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:909
static SW_DLLPUBLIC SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1370
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:1035
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:149
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:155
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 const & GetOpenRedlineId()
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:634
Reference< XComponentContext > getProcessComponentContext()
IMPRESS
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:130
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:3402
void setX(long x)
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1728
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:799
sal_Int32 nPos
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
#define SO3_PLUGIN_CLASSID
#define SIZE_NOT_SET
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
XMLRedlineImportHelper * pRedlineHelper
Definition: xmltexti.hxx:29
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)