LibreOffice Module xmloff (master)  1
txtimp.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 
20 #include <memory>
21 #include <tuple>
22 #include <vector>
23 
24 #include <com/sun/star/container/XEnumerationAccess.hpp>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28 #include <com/sun/star/text/ReferenceFieldSource.hpp>
29 #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
30 #include <com/sun/star/text/XTextFrame.hpp>
31 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
32 #include <com/sun/star/text/XTextFramesSupplier.hpp>
33 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
34 #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
35 #include <com/sun/star/text/XFormField.hpp>
36 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
37 #include <com/sun/star/container/XNamed.hpp>
38 #include <com/sun/star/style/XStyle.hpp>
39 #include <xmloff/xmlnamespace.hxx>
40 #include <xmloff/txtstyli.hxx>
41 #include <xmloff/xmlnumi.hxx>
42 #include <xmloff/maptype.hxx>
43 
44 #include <sal/log.hxx>
45 #include "txtparai.hxx"
46 #include <xmloff/txtprmap.hxx>
47 #include <xmloff/txtimppr.hxx>
48 #include <xmloff/xmlimp.hxx>
49 #include <txtvfldi.hxx>
50 #include <xmloff/i18nmap.hxx>
53 #include "XMLTextFrameContext.hxx"
56 #include "XMLIndexTOCContext.hxx"
62 
65 #include <PageMasterStyleMap.hxx>
67 #include <PageMasterPropMapper.hxx>
68 // XML import: reconstruction of assignment of paragraph style to outline levels (#i69629#)
69 #include <com/sun/star/beans/XPropertyState.hpp>
70 #include <txtlists.hxx>
71 #include <xmloff/odffields.hxx>
72 
73 using ::com::sun::star::ucb::XAnyCompare;
74 
75 using namespace ::std;
76 using namespace ::com::sun::star;
77 using namespace ::com::sun::star::uno;
78 using namespace ::com::sun::star::beans;
79 using namespace ::com::sun::star::text;
80 using namespace ::com::sun::star::frame;
81 using namespace ::com::sun::star::style;
82 using namespace ::com::sun::star::container;
83 using namespace ::com::sun::star::drawing;
84 using namespace ::com::sun::star::xml::sax;
85 using namespace ::com::sun::star::lang;
86 using namespace ::xmloff::token;
87 using namespace ::com::sun::star::ucb;
88 
90 {
119  // #i52127#
121 
123 };
124 
126 {
134 
144 
147 
148  // index marks
163 
164  // sender fields
167  // note: loext was written by accident in some LO versions, don't remove!
186 
187  // misc. document fields
195 
196  // variable fields
205 
206  // database fields
216 
217  // docinfo fields
242 
243  // misc fields
275 
276  // Calc fields
278 
279  // draw fields
283 
284  // RDF metadata
287 
288  // redlining (aka change tracking)
292 
297 
301 
302 
304 };
305 
307 {
323 };
324 
326 {
338 };
339 
341 {
350 };
351 
353 {
357 };
358 
360 {
388 };
389 
391 {
399 };
400 
402 {
411 };
412 
413 
414 // maximum allowed length of combined characters field
415 #define MAX_COMBINED_CHARACTERS 6
416 
418 {
419  std::unique_ptr<SvXMLTokenMap> m_xTextElemTokenMap;
420  std::unique_ptr<SvXMLTokenMap> m_xTextPElemTokenMap;
421  std::unique_ptr<SvXMLTokenMap> m_xTextPAttrTokenMap;
422  std::unique_ptr<SvXMLTokenMap> m_xTextNumberedParagraphAttrTokenMap;
423  std::unique_ptr<SvXMLTokenMap> m_xTextListBlockAttrTokenMap;
424  std::unique_ptr<SvXMLTokenMap> m_xTextListBlockElemTokenMap;
425  std::unique_ptr<SvXMLTokenMap> m_xTextFrameAttrTokenMap;
426  std::unique_ptr<SvXMLTokenMap> m_xTextContourAttrTokenMap;
427  std::unique_ptr<SvXMLTokenMap> m_xTextHyperlinkAttrTokenMap;
428  std::unique_ptr< std::vector<OUString> > m_xPrevFrmNames;
429  std::unique_ptr< std::vector<OUString> > m_xNextFrmNames;
430  std::unique_ptr<XMLTextListsHelper> m_xTextListsHelper;
431 
433 
439 
440  std::unique_ptr<SvI18NMap> m_xRenameMap;
441 
442  /* Change and extend data structure:
443  - data structure contains candidates of paragraph styles, which
444  will be assigned to the outline style
445  - data structure contains more than one candidate for each list level
446  of the outline style (#i69629#)
447  */
448  std::unique_ptr< std::vector< OUString > []>
450 
451  // start range, xml:id, RDFa stuff
452  typedef std::tuple<
453  uno::Reference<text::XTextRange>, OUString,
454  std::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
457  std::map< OUString, BookmarkMapEntry_t > m_BookmarkStartRanges;
458 
459  std::vector< OUString > m_BookmarkVector;
460 
463 
464  // Used for frame deduplication, the name of the last frame imported directly before the current one
466 
467  std::map< OUString, bool > m_bBookmarkHidden;
468  std::map< OUString, OUString > m_sBookmarkCondition;
469 
470  uno::Reference<text::XText> m_xText;
471  uno::Reference<text::XTextCursor> m_xCursor;
472  uno::Reference<text::XTextRange> m_xCursorAsRange;
473  uno::Reference<container::XNameContainer> m_xParaStyles;
474  uno::Reference<container::XNameContainer> m_xTextStyles;
475  uno::Reference<container::XNameContainer> m_xNumStyles;
476  uno::Reference<container::XNameContainer> m_xFrameStyles;
477  uno::Reference<container::XNameContainer> m_xPageStyles;
478  uno::Reference<container::XNameContainer> m_xCellStyles;
479  uno::Reference<container::XIndexReplace> m_xChapterNumbering;
480  uno::Reference<container::XNameAccess> m_xTextFrames;
481  uno::Reference<container::XNameAccess> m_xGraphics;
482  uno::Reference<container::XNameAccess> m_xObjects;
483  uno::Reference<lang::XMultiServiceFactory> m_xServiceFactory;
484 
486 
487  bool m_bInsertMode : 1;
489  bool m_bBlockMode : 1;
490  bool m_bProgress : 1;
493 
496 
497  typedef ::std::pair< OUString, OUString> field_name_type_t;
498  typedef ::std::pair< OUString, OUString > field_param_t;
499  typedef ::std::vector< field_param_t > field_params_t;
500  typedef ::std::tuple<field_name_type_t, field_params_t, uno::Reference<text::XFormField>> field_stack_item_t;
501  typedef ::std::stack< field_stack_item_t > field_stack_t;
502 
503  field_stack_t m_FieldStack;
504 
506 
507  std::unique_ptr<std::map<OUString, OUString>> m_pCrossRefHeadingBookmarkMap;
508 
509  Impl( uno::Reference<frame::XModel> const& rModel,
510  SvXMLImport & rImport,
511  bool const bInsertMode, bool const bStylesOnlyMode,
512  bool const bProgress, bool const bBlockMode,
513  bool const bOrganizerMode)
514  : m_xTextListsHelper( new XMLTextListsHelper() )
515  // XML import: reconstruction of assignment of paragraph style to outline levels (#i69629#)
516  , m_xServiceFactory( rModel, UNO_QUERY )
517  , m_rSvXMLImport( rImport )
518  , m_bInsertMode( bInsertMode )
519  , m_bStylesOnlyMode( bStylesOnlyMode )
520  , m_bBlockMode( bBlockMode )
521  , m_bProgress( bProgress )
522  , m_bOrganizerMode( bOrganizerMode )
523  , m_bBodyContentStarted( true )
524  , m_bInsideDeleteContext( false )
525  {
526  }
527  Impl(const Impl&) = delete;
528  Impl& operator=(const Impl&) = delete;
529 
531  {
533  {
534  size_t const size(m_xChapterNumbering->getCount());
536  new ::std::vector< OUString >[size] );
537  }
538  }
539 
540 };
541 
542 
543 uno::Reference< text::XText > & XMLTextImportHelper::GetText()
544 {
545  return m_xImpl->m_xText;
546 }
547 
548 uno::Reference< text::XTextCursor > & XMLTextImportHelper::GetCursor()
549 {
550  return m_xImpl->m_xCursor;
551 }
552 
553 uno::Reference< text::XTextRange > & XMLTextImportHelper::GetCursorAsRange()
554 {
555  return m_xImpl->m_xCursorAsRange;
556 }
557 
559 {
560  return m_xImpl->m_bInsertMode;
561 }
562 
564 {
565  return m_xImpl->m_bStylesOnlyMode;
566 }
567 
569 {
570  return m_xImpl->m_bBlockMode;
571 }
572 
574 {
575  return m_xImpl->m_bOrganizerMode;
576 }
577 
579 {
580  return m_xImpl->m_bProgress;
581 }
582 
583 uno::Reference<container::XNameContainer> const&
585 {
586  return m_xImpl->m_xParaStyles;
587 }
588 
589 uno::Reference<container::XNameContainer> const&
591 {
592  return m_xImpl->m_xTextStyles;
593 }
594 
595 uno::Reference<container::XNameContainer> const&
597 {
598  return m_xImpl->m_xNumStyles;
599 }
600 
601 uno::Reference<container::XNameContainer> const&
603 {
604  return m_xImpl->m_xFrameStyles;
605 }
606 
607 uno::Reference<container::XNameContainer> const&
609 {
610  return m_xImpl->m_xPageStyles;
611 }
612 
613 uno::Reference<container::XNameContainer> const&
615 {
616  return m_xImpl->m_xCellStyles;
617 }
618 
619 uno::Reference<container::XIndexReplace> const&
621 {
622  return m_xImpl->m_xChapterNumbering;
623 }
624 
627 {
628  return m_xImpl->m_xParaImpPrMap;
629 }
630 
633 {
634  return m_xImpl->m_xTextImpPrMap;
635 }
636 
639 {
640  return m_xImpl->m_xSectionImpPrMap;
641 }
642 
645 {
646  return m_xImpl->m_xRubyImpPrMap;
647 }
648 
650 {
651  m_xImpl->m_bInsideDeleteContext = bNew;
652 }
653 
655 {
656  return m_xImpl->m_bInsideDeleteContext;
657 }
658 
660 {
661  return m_xImpl->m_rSvXMLImport;
662 }
663 
665 {
666  return *m_xImpl->m_xTextListsHelper;
667 }
668 
670 {
671  if (!m_xImpl->m_xTextElemTokenMap)
672  {
673  m_xImpl->m_xTextElemTokenMap.reset(
674  new SvXMLTokenMap( aTextElemTokenMap ));
675  }
676  return *m_xImpl->m_xTextElemTokenMap;
677 }
678 
680 {
681  if (!m_xImpl->m_xTextPElemTokenMap)
682  {
683  m_xImpl->m_xTextPElemTokenMap.reset(
684  new SvXMLTokenMap( aTextPElemTokenMap ));
685  }
686  return *m_xImpl->m_xTextPElemTokenMap;
687 }
688 
690 {
691  if (!m_xImpl->m_xTextPAttrTokenMap)
692  {
693  m_xImpl->m_xTextPAttrTokenMap.reset(
694  new SvXMLTokenMap( aTextPAttrTokenMap ));
695  }
696  return *m_xImpl->m_xTextPAttrTokenMap;
697 }
698 
700 {
701  if (!m_xImpl->m_xTextFrameAttrTokenMap)
702  {
703  m_xImpl->m_xTextFrameAttrTokenMap.reset(
704  new SvXMLTokenMap( aTextFrameAttrTokenMap ));
705  }
706  return *m_xImpl->m_xTextFrameAttrTokenMap;
707 }
708 
710 {
711  if (!m_xImpl->m_xTextContourAttrTokenMap)
712  {
713  m_xImpl->m_xTextContourAttrTokenMap.reset(
714  new SvXMLTokenMap( aTextContourAttrTokenMap ));
715  }
716  return *m_xImpl->m_xTextContourAttrTokenMap;
717 }
718 
720 {
721  if (!m_xImpl->m_xTextHyperlinkAttrTokenMap)
722  {
723  m_xImpl->m_xTextHyperlinkAttrTokenMap.reset(
724  new SvXMLTokenMap( aTextHyperlinkAttrTokenMap ));
725  }
726  return *m_xImpl->m_xTextHyperlinkAttrTokenMap;
727 }
728 
729 namespace
730 {
731  class FieldParamImporter
732  {
733  public:
734  typedef pair<OUString,OUString> field_param_t;
735  typedef vector<field_param_t> field_params_t;
736  FieldParamImporter(const field_params_t* const pInParams, Reference<XNameContainer> const & xOutParams)
737  : m_pInParams(pInParams)
738  , m_xOutParams(xOutParams)
739  { };
740  void Import();
741 
742  private:
743  const field_params_t* const m_pInParams;
744  Reference<XNameContainer> m_xOutParams;
745  };
746 
747  void FieldParamImporter::Import()
748  {
749  ::std::vector<OUString> vListEntries;
750  ::std::map<OUString, Any> vOutParams;
751  for(const auto& rCurrent : *m_pInParams)
752  {
753  if(rCurrent.first == ODF_FORMDROPDOWN_RESULT)
754  {
755  // sal_Int32
756  vOutParams[rCurrent.first] <<= rCurrent.second.toInt32();
757  }
758  else if(rCurrent.first == ODF_FORMCHECKBOX_RESULT)
759  {
760  // bool
761  vOutParams[rCurrent.first] <<= rCurrent.second.toBoolean();
762  }
763  else if(rCurrent.first == ODF_FORMDROPDOWN_LISTENTRY)
764  {
765  // sequence
766  vListEntries.push_back(rCurrent.second);
767  }
768  else
769  vOutParams[rCurrent.first] <<= rCurrent.second;
770  }
771  if(!vListEntries.empty())
772  {
773  Sequence<OUString> vListEntriesSeq(vListEntries.size());
774  copy(vListEntries.begin(), vListEntries.end(), vListEntriesSeq.begin());
775  vOutParams[OUString(ODF_FORMDROPDOWN_LISTENTRY)] <<= vListEntriesSeq;
776  }
777  for(const auto& rCurrent : vOutParams)
778  {
779  try
780  {
781  m_xOutParams->insertByName(rCurrent.first, rCurrent.second);
782  }
783  catch(const ElementExistException&)
784  {
785  }
786  }
787  }
788 }
789 
791  uno::Reference<frame::XModel> const& rModel,
792  SvXMLImport& rImport,
793  bool const bInsertMode, bool const bStylesOnlyMode,
794  bool const bProgress, bool const bBlockMode,
795  bool const bOrganizerMode)
796  : m_xImpl( new Impl(rModel, rImport, bInsertMode, bStylesOnlyMode,
797  bProgress, bBlockMode, bOrganizerMode) )
798  , m_xBackpatcherImpl( MakeBackpatcherImpl() )
799 {
800  static const char s_PropNameDefaultListId[] = "DefaultListId";
801 
802  Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY );
803 
804  if (xCNSupplier.is())
805  {
806  // note: m_xChapterNumbering is accessed to import some fields
807  m_xImpl->m_xChapterNumbering = xCNSupplier->getChapterNumberingRules();
808  // the AutoCorrect document doesn't have a proper outline numbering
809  if (!IsBlockMode() && m_xImpl->m_xChapterNumbering.is())
810  {
811  Reference< XPropertySet > const xNumRuleProps(
812  m_xImpl->m_xChapterNumbering, UNO_QUERY);
813  if ( xNumRuleProps.is() )
814  {
815  Reference< XPropertySetInfo > xNumRulePropSetInfo(
816  xNumRuleProps->getPropertySetInfo());
817  if (xNumRulePropSetInfo.is() &&
818  xNumRulePropSetInfo->hasPropertyByName(
819  s_PropNameDefaultListId))
820  {
821  OUString sListId;
822  xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
823  >>= sListId;
824  assert( !sListId.isEmpty() &&
825  "no default list id found at chapter numbering rules instance. Serious defect." );
826  if ( !sListId.isEmpty() )
827  {
828  Reference< XNamed > const xChapterNumNamed(
829  m_xImpl->m_xChapterNumbering, UNO_QUERY);
830  if ( xChapterNumNamed.is() )
831  {
832  m_xImpl->m_xTextListsHelper->KeepListAsProcessed(
833  sListId,
834  xChapterNumNamed->getName(),
835  OUString() );
836  }
837  }
838  }
839  }
840  }
841  }
842 
843  Reference< XStyleFamiliesSupplier > xFamiliesSupp( rModel, UNO_QUERY );
844 // SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff", "no chapter numbering supplier" ); for clipboard there may be documents without styles
845 
846  if( xFamiliesSupp.is() )
847  {
848  Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
849 
850  const OUString aParaStyles("ParagraphStyles");
851  if( xFamilies->hasByName( aParaStyles ) )
852  {
853  m_xImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
854  UNO_QUERY);
855  }
856 
857  const OUString aCharStyles("CharacterStyles");
858  if( xFamilies->hasByName( aCharStyles ) )
859  {
860  m_xImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
861  UNO_QUERY);
862  }
863 
864  const OUString aNumStyles("NumberingStyles");
865  if( xFamilies->hasByName( aNumStyles ) )
866  {
867  m_xImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
868  UNO_QUERY);
869  }
870 
871  const OUString aFrameStyles("FrameStyles");
872  if( xFamilies->hasByName( aFrameStyles ) )
873  {
874  m_xImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
875  UNO_QUERY);
876  }
877 
878  const OUString aPageStyles("PageStyles");
879  if( xFamilies->hasByName( aPageStyles ) )
880  {
881  m_xImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
882  UNO_QUERY);
883  }
884 
885  const OUString aCellStyles("CellStyles");
886  if( xFamilies->hasByName( aCellStyles ) )
887  {
888  m_xImpl->m_xCellStyles.set(xFamilies->getByName(aCellStyles),
889  UNO_QUERY);
890  }
891  }
892 
893  Reference < XTextFramesSupplier > xTFS( rModel, UNO_QUERY );
894  if( xTFS.is() )
895  {
896  m_xImpl->m_xTextFrames.set(xTFS->getTextFrames());
897  }
898 
899  Reference < XTextGraphicObjectsSupplier > xTGOS( rModel, UNO_QUERY );
900  if( xTGOS.is() )
901  {
902  m_xImpl->m_xGraphics.set(xTGOS->getGraphicObjects());
903  }
904 
905  Reference < XTextEmbeddedObjectsSupplier > xTEOS( rModel, UNO_QUERY );
906  if( xTEOS.is() )
907  {
908  m_xImpl->m_xObjects.set(xTEOS->getEmbeddedObjects());
909  }
910 
911  XMLPropertySetMapper *pPropMapper =
913  m_xImpl->m_xParaImpPrMap =
914  new XMLTextImportPropertyMapper( pPropMapper, rImport );
915 
916  pPropMapper = new XMLTextPropertySetMapper( TextPropMap::TEXT, false );
917  m_xImpl->m_xTextImpPrMap =
918  new XMLTextImportPropertyMapper( pPropMapper, rImport );
919 
920  pPropMapper = new XMLTextPropertySetMapper( TextPropMap::FRAME, false );
921  m_xImpl->m_xFrameImpPrMap =
922  new XMLTextImportPropertyMapper( pPropMapper, rImport );
923 
924  pPropMapper = new XMLTextPropertySetMapper( TextPropMap::SECTION, false );
925  m_xImpl->m_xSectionImpPrMap =
926  new XMLTextImportPropertyMapper( pPropMapper, rImport );
927 
928  pPropMapper = new XMLTextPropertySetMapper( TextPropMap::RUBY, false );
929  m_xImpl->m_xRubyImpPrMap =
930  new SvXMLImportPropertyMapper( pPropMapper, rImport );
931 }
932 
934 {
935 }
936 
938 {
939  if (m_xImpl->m_xAutoStyles)
940  m_xImpl->m_xAutoStyles->dispose();
941 }
942 
944 {
945  XMLPropertySetMapper *pPropMapper =
947  return new XMLTextImportPropertyMapper( pPropMapper, rImport );
948 }
949 
951 {
952  XMLPropertySetMapper *pPropMapper =
954  return new XMLTextImportPropertyMapper( pPropMapper, rImport );
955 }
956 
958 {
959  XMLPropertySetMapper* pPropMapper =
961  SvXMLImportPropertyMapper* pImportMapper = new XMLTextImportPropertyMapper( pPropMapper, rImport );
962 
963  pPropMapper =
965  pImportMapper->ChainImportMapper( new XMLTextImportPropertyMapper( pPropMapper, rImport ) );
966 
967  return pImportMapper;
968 }
969 
972  SvXMLImport& rImport )
973 {
974  XMLPropertySetMapper *pPropMapper =
976  return new SvXMLImportPropertyMapper( pPropMapper, rImport );
977 }
978 
981  SvXMLImport& rImport )
982 {
983  XMLPropertySetMapper *pPropMapper =
985  return new SvXMLImportPropertyMapper( pPropMapper, rImport );
986 }
987 
990  SvXMLImport& rImport )
991 {
992  XMLPropertySetMapper *pPropMapper =
994  return new XMLTextImportPropertyMapper( pPropMapper, rImport );
995 }
996 
999 {
1001  XMLPropertySetMapper *const pPropMapper(
1003  return new SvXMLImportPropertyMapper(pPropMapper, rImport);
1004 }
1005 
1006 void XMLTextImportHelper::SetCursor( const Reference < XTextCursor > & rCursor )
1007 {
1008  m_xImpl->m_xCursor.set(rCursor);
1009  m_xImpl->m_xText.set(rCursor->getText());
1010  m_xImpl->m_xCursorAsRange = rCursor;
1011 }
1012 
1014 {
1015  m_xImpl->m_xCursor.set(nullptr);
1016  m_xImpl->m_xText.set(nullptr);
1017  m_xImpl->m_xCursorAsRange.set(nullptr);
1018 }
1019 
1020 
1021 bool XMLTextImportHelper::HasFrameByName( const OUString& rName ) const
1022 {
1023  return (m_xImpl->m_xTextFrames.is() &&
1024  m_xImpl->m_xTextFrames->hasByName(rName))
1025  || (m_xImpl->m_xGraphics.is() &&
1026  m_xImpl->m_xGraphics->hasByName(rName))
1027  || (m_xImpl->m_xObjects.is() &&
1028  m_xImpl->m_xObjects->hasByName(rName));
1029 }
1030 
1031 bool XMLTextImportHelper::IsDuplicateFrame(const OUString& sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) const
1032 {
1033  if (HasFrameByName(sName))
1034  {
1035  uno::Reference<beans::XPropertySet> xOtherFrame;
1036  if(m_xImpl->m_xTextFrames.is() && m_xImpl->m_xTextFrames->hasByName(sName))
1037  xOtherFrame.set(m_xImpl->m_xTextFrames->getByName(sName), uno::UNO_QUERY);
1038  else if(m_xImpl->m_xGraphics.is() && m_xImpl->m_xGraphics->hasByName(sName))
1039  xOtherFrame.set(m_xImpl->m_xGraphics->getByName(sName), uno::UNO_QUERY);
1040  else if (m_xImpl->m_xObjects.is() && m_xImpl->m_xObjects->hasByName(sName))
1041  xOtherFrame.set(m_xImpl->m_xObjects->getByName(sName), uno::UNO_QUERY);
1042 
1043  Reference< XPropertySetInfo > xPropSetInfo = xOtherFrame->getPropertySetInfo();
1044  if(xPropSetInfo->hasPropertyByName("Width"))
1045  {
1046  sal_Int32 nOtherWidth = 0;
1047  xOtherFrame->getPropertyValue("Width") >>= nOtherWidth;
1048  if(nWidth != nOtherWidth)
1049  return false;
1050  }
1051 
1052  if (xPropSetInfo->hasPropertyByName("Height"))
1053  {
1054  sal_Int32 nOtherHeight = 0;
1055  xOtherFrame->getPropertyValue("Height") >>= nOtherHeight;
1056  if (nHeight != nOtherHeight)
1057  return false;
1058  }
1059 
1060  if (xPropSetInfo->hasPropertyByName("HoriOrientPosition"))
1061  {
1062  sal_Int32 nOtherX = 0;
1063  xOtherFrame->getPropertyValue("HoriOrientPosition") >>= nOtherX;
1064  if (nX != nOtherX)
1065  return false;
1066  }
1067 
1068  if (xPropSetInfo->hasPropertyByName("VertOrientPosition"))
1069  {
1070  sal_Int32 nOtherY = 0;
1071  xOtherFrame->getPropertyValue("VertOrientPosition") >>= nOtherY;
1072  if (nY != nOtherY)
1073  return false;
1074  }
1075 
1076  // In some case, position is not defined for frames, so check whether the two frames follow each other (are anchored to the same position)
1077  return m_xImpl->msLastImportedFrameName == sName;
1078  }
1079  return false;
1080 }
1081 
1083 {
1084  m_xImpl->msLastImportedFrameName = rName;
1085 }
1086 
1088 {
1089  m_xImpl->msLastImportedFrameName.clear();
1090 }
1091 
1092 void XMLTextImportHelper::InsertString( const OUString& rChars )
1093 {
1094  assert(m_xImpl->m_xText.is());
1095  assert(m_xImpl->m_xCursorAsRange.is());
1096  if (m_xImpl->m_xText.is())
1097  {
1098  m_xImpl->m_xText->insertString(m_xImpl->m_xCursorAsRange,
1099  rChars, false);
1100  }
1101 }
1102 
1103 void XMLTextImportHelper::InsertString( const OUString& rChars,
1104  bool& rIgnoreLeadingSpace )
1105 {
1106  assert(m_xImpl->m_xText.is());
1107  assert(m_xImpl->m_xCursorAsRange.is());
1108  if (m_xImpl->m_xText.is())
1109  {
1110  sal_Int32 nLen = rChars.getLength();
1111  OUStringBuffer sChars( nLen );
1112 
1113  for( sal_Int32 i=0; i < nLen; i++ )
1114  {
1115  sal_Unicode c = rChars[i];
1116  switch( c )
1117  {
1118  case 0x20:
1119  case 0x09:
1120  case 0x0a:
1121  case 0x0d:
1122  if( !rIgnoreLeadingSpace )
1123  sChars.append( u' ' );
1124  rIgnoreLeadingSpace = true;
1125  break;
1126  default:
1127  rIgnoreLeadingSpace = false;
1128  sChars.append( c );
1129  break;
1130  }
1131  }
1132  m_xImpl->m_xText->insertString(m_xImpl->m_xCursorAsRange,
1133  sChars.makeStringAndClear(), false);
1134  }
1135 }
1136 
1138 {
1139  assert(m_xImpl->m_xText.is());
1140  assert(m_xImpl->m_xCursorAsRange.is());
1141  if (m_xImpl->m_xText.is())
1142  {
1143  m_xImpl->m_xText->insertControlCharacter(
1144  m_xImpl->m_xCursorAsRange, nControl, false);
1145  }
1146 }
1147 
1149  Reference < XTextContent > const & xContent )
1150 {
1151  assert(m_xImpl->m_xText.is());
1152  assert(m_xImpl->m_xCursorAsRange.is());
1153  if (m_xImpl->m_xText.is())
1154  {
1155  // note: this may throw IllegalArgumentException and callers handle it
1156  m_xImpl->m_xText->insertTextContent( m_xImpl->m_xCursorAsRange, xContent, false);
1157  }
1158 }
1159 
1161 {
1162  assert(m_xImpl->m_xText.is());
1163  assert(m_xImpl->m_xCursor.is());
1164  assert(m_xImpl->m_xCursorAsRange.is());
1165 
1166  bool bDelete = true;
1167  Reference < XEnumerationAccess > const xEnumAccess(
1168  m_xImpl->m_xCursor, UNO_QUERY);
1169  if( xEnumAccess.is() )
1170  {
1171  Reference < XEnumeration > xEnum(xEnumAccess->createEnumeration());
1172  SAL_WARN_IF(!xEnum->hasMoreElements(), "xmloff.text",
1173  "empty text enumeration");
1174  if( xEnum->hasMoreElements() )
1175  {
1176  Reference < XComponent > xComp( xEnum->nextElement(), UNO_QUERY );
1177  assert(xComp.is());
1178  if( xComp.is() )
1179  {
1180  xComp->dispose();
1181  bDelete = false;
1182  }
1183  }
1184  }
1185  if( bDelete )
1186  {
1187  if (m_xImpl->m_xCursor->goLeft( 1, true ))
1188  {
1189  m_xImpl->m_xText->insertString(m_xImpl->m_xCursorAsRange,
1190  "", true);
1191  }
1192  }
1193 }
1194 
1195 OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
1196  const OUString& rStyleName,
1197  sal_uInt8& rFlags,
1198  bool bPara,
1199  SvXMLImport& rImport ) const
1200 {
1201  OUStringBuffer sChars( rChars );
1202  bool bConverted = false;
1203  for( sal_Int32 j=0; j<rChars.getLength(); j++ )
1204  {
1205  sal_Unicode c = rChars[j];
1206  if( c >= 0xf000 && c <= 0xf0ff )
1207  {
1208  if( (rFlags & CONV_STAR_FONT_FLAGS_VALID) == 0 )
1209  {
1210  XMLTextStyleContext *pStyle = nullptr;
1213  if (!rStyleName.isEmpty() && m_xImpl->m_xAutoStyles.is())
1214  {
1215  const SvXMLStyleContext* pTempStyle =
1216  m_xImpl->m_xAutoStyles->
1217  FindStyleChildContext( nFamily, rStyleName,
1218  true );
1219  pStyle = const_cast<XMLTextStyleContext*>( dynamic_cast< const XMLTextStyleContext* >(pTempStyle));
1220  }
1221 
1222  if( pStyle )
1223  {
1224  sal_Int32 nCount = pStyle->GetProperties_().size();
1225  if( nCount )
1226  {
1228  m_xImpl->m_xAutoStyles->GetImportPropertyMapper(nFamily);
1229  if( xImpPrMap.is() )
1230  {
1232  xImpPrMap->getPropertySetMapper();
1233  for( sal_Int32 i=0; i < nCount; i++ )
1234  {
1235  const XMLPropertyState& rProp = pStyle->GetProperties_()[i];
1236  sal_Int32 nIdx = rProp.mnIndex;
1237  sal_uInt32 nContextId = rPropMapper->GetEntryContextId(nIdx);
1238  if( CTF_FONTFAMILYNAME == nContextId )
1239  {
1241  OUString sFontName;
1242  rProp.maValue >>= sFontName;
1243  if( sFontName.equalsIgnoreAsciiCase( "StarBats" ) )
1244  rFlags |= CONV_FROM_STAR_BATS;
1245  else if( sFontName.equalsIgnoreAsciiCase( "StarMath" ) )
1246  rFlags |= CONV_FROM_STAR_MATH;
1247  break;
1248  }
1249  }
1250  }
1251  }
1252 
1253  }
1254 
1255  rFlags |= CONV_STAR_FONT_FLAGS_VALID;
1256  }
1257  if( (rFlags & CONV_FROM_STAR_BATS ) != 0 )
1258  {
1259  sChars[j] = rImport.ConvStarBatsCharToStarSymbol( c );
1260  bConverted = true;
1261  }
1262  else if( (rFlags & CONV_FROM_STAR_MATH ) != 0 )
1263  {
1264  sChars[j] = rImport.ConvStarMathCharToStarSymbol( c );
1265  bConverted = true;
1266  }
1267  }
1268  }
1269 
1270  return bConverted ? sChars.makeStringAndClear() : rChars;
1271 }
1272 
1273 /* Helper method to determine, if a paragraph style has a list style (inclusive
1274  an empty one) inherits a list style (inclusive an empty one) from one of its parents (#i69629#)
1275 */
1276 /* Apply special case, that found list style equals the chapter numbering, also
1277  to the found list styles of the parent styles. (#i73973#)
1278 */
1279 static bool lcl_HasListStyle( const OUString& sStyleName,
1280  const Reference < XNameContainer >& xParaStyles,
1281  SvXMLImport const & rImport,
1282  const OUString& sNumberingStyleName,
1283  std::u16string_view sOutlineStyleName )
1284 {
1285  bool bRet( false );
1286 
1287  if ( !xParaStyles->hasByName( sStyleName ) )
1288  {
1289  // error case
1290  return true;
1291  }
1292 
1293  Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
1294  UNO_QUERY );
1295  if ( !xPropState.is() )
1296  {
1297  // error case
1298  return false;
1299  }
1300 
1301  if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
1302  {
1303  // list style found
1304  bRet = true;
1305  // special case: the set list style equals the chapter numbering
1306  Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
1307  if ( xPropSet.is() )
1308  {
1309  OUString sListStyle;
1310  xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
1311  if ( !sListStyle.isEmpty() &&
1312  sListStyle == sOutlineStyleName )
1313  {
1314  bRet = false;
1315  }
1316  }
1317  }
1318  else
1319  {
1320  // Tools.Outline settings lost on Save (#i77708#)
1321  sal_Int32 nUPD( 0 );
1322  sal_Int32 nBuild( 0 );
1323  // Don't use UPD for versioning: xmloff/source/text/txtstyli.cxx and txtimp.cxx (#i86058#)
1324  const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
1325  // search list style at parent
1326  Reference<XStyle> xStyle( xPropState, UNO_QUERY );
1327  while ( xStyle.is() )
1328  {
1329  OUString aParentStyle( xStyle->getParentStyle() );
1330  if ( !aParentStyle.isEmpty() )
1331  {
1332  aParentStyle =
1334  aParentStyle );
1335  }
1336  if ( aParentStyle.isEmpty() || !xParaStyles->hasByName( aParentStyle ) )
1337  {
1338  // no list style found
1339  break;
1340  }
1341  else
1342  {
1343  xPropState.set( xParaStyles->getByName( aParentStyle ),
1344  UNO_QUERY );
1345  if ( !xPropState.is() )
1346  {
1347  // error case
1348  return true;
1349  }
1350  if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
1351  {
1352  // list style found
1353  bRet = true;
1354  // Special case: the found list style equals the chapter numbering (#i73973#)
1355  Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
1356  if ( xPropSet.is() )
1357  {
1358  OUString sListStyle;
1359  xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
1360  if ( !sListStyle.isEmpty() &&
1361  sListStyle == sOutlineStyleName )
1362  {
1363  bRet = false;
1364  }
1365  // Special handling for text documents from OOo version prior OOo 2.4 (#i77708#)
1366  /* Check explicitly on certain versions and on import of
1367  text documents in OpenOffice.org file format (#i86058#)
1368  */
1369  else if ( sListStyle.isEmpty() &&
1370  ( rImport.IsTextDocInOOoFileFormat() ||
1371  ( bBuildIdFound &&
1372  ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
1373  ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
1374  {
1375  bRet = false;
1376  }
1377  }
1378  break;
1379  }
1380  else
1381  {
1382  // search list style at parent
1383  Reference<XStyle> xParentStyle(xPropState, UNO_QUERY);
1384  if (xStyle == xParentStyle)
1385  {
1386  // error case
1387  return true;
1388  }
1389  xStyle = xParentStyle;
1390  }
1391  }
1392  }
1393  }
1394 
1395  return bRet;
1396 }
1398  SvXMLImport const & rImport,
1399  const Reference < XTextCursor >& rCursor,
1400  const OUString& rStyleName,
1401  bool bPara,
1402  bool bOutlineLevelAttrFound,
1403  sal_Int8 nOutlineLevel,
1404  // Numberings/Bullets in table not visible after save/reload (#i80724#)
1405  bool bSetListAttrs,
1406  bool bOutlineContentVisible)
1407 {
1408  static const char s_NumberingRules[] = "NumberingRules";
1409  static const char s_NumberingIsNumber[] = "NumberingIsNumber";
1410  static const char s_NumberingLevel[] = "NumberingLevel";
1411  static const char s_ParaIsNumberingRestart[] = "ParaIsNumberingRestart";
1412  static const char s_NumberingStartValue[] = "NumberingStartValue";
1413  static const char s_PropNameListId[] = "ListId";
1414  static const char s_PageDescName[] = "PageDescName";
1415  static const char s_OutlineLevel[] = "OutlineLevel";
1416 
1417  const XmlStyleFamily nFamily = bPara ? XmlStyleFamily::TEXT_PARAGRAPH
1419  XMLTextStyleContext *pStyle = nullptr;
1420  OUString sStyleName( rStyleName );
1421  if (!sStyleName.isEmpty() && m_xImpl->m_xAutoStyles.is())
1422  {
1423  const SvXMLStyleContext* pTempStyle =
1424  m_xImpl->m_xAutoStyles->FindStyleChildContext( nFamily, sStyleName, true );
1425  pStyle = const_cast<XMLTextStyleContext*>(dynamic_cast< const XMLTextStyleContext* >(pTempStyle));
1426  }
1427  if( pStyle )
1428  sStyleName = pStyle->GetParentName();
1429 
1430  Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
1431  Reference< XPropertySetInfo > xPropSetInfo(
1432  xPropSet->getPropertySetInfo());
1433 
1434  // style
1435  if( !sStyleName.isEmpty() )
1436  {
1437  sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName );
1438  const OUString rPropName = bPara ? OUString("ParaStyleName") : OUString("CharStyleName");
1439  const Reference < XNameContainer > & rStyles = bPara
1440  ? m_xImpl->m_xParaStyles
1441  : m_xImpl->m_xTextStyles;
1442  if( rStyles.is() &&
1443  xPropSetInfo->hasPropertyByName( rPropName ) &&
1444  rStyles->hasByName( sStyleName ) )
1445  {
1446  xPropSet->setPropertyValue( rPropName, makeAny(sStyleName) );
1447  }
1448  else
1449  sStyleName.clear();
1450  }
1451 
1452  /* The outline level needs to be only applied as list level, if the heading
1453  is not inside a list and if it by default applies the outline style. (#i70748#)
1454  */
1455  bool bApplyOutlineLevelAsListLevel( false );
1456  // Numberings/Bullets in table not visible after save/reload (#i80724#)
1457  if (bSetListAttrs && bPara
1458  && xPropSetInfo->hasPropertyByName( s_NumberingRules))
1459  {
1460  // Set numbering rules
1461  Reference< XIndexReplace > const xNumRules(
1462  xPropSet->getPropertyValue(s_NumberingRules), UNO_QUERY);
1463 
1464  XMLTextListBlockContext * pListBlock(nullptr);
1465  XMLTextListItemContext * pListItem(nullptr);
1466  XMLNumberedParaContext * pNumberedParagraph(nullptr);
1468  pListBlock, pListItem, pNumberedParagraph);
1469 
1470  assert(!(pListBlock && pNumberedParagraph) && "XMLTextImportHelper::"
1471  "SetStyleAndAttrs: both list and numbered-paragraph???");
1472 
1473  Reference < XIndexReplace > xNewNumRules;
1474  sal_Int8 nLevel(-1);
1475  OUString sListId;
1476  sal_Int16 nStartValue(-1);
1477  bool bNumberingIsNumber(true);
1478 
1479  if (pListBlock) {
1480 
1481  if (!pListItem) {
1482  bNumberingIsNumber = false; // list-header
1483  }
1484  // consider text:style-override property of <text:list-item>
1485  xNewNumRules.set(
1486  (pListItem != nullptr && pListItem->HasNumRulesOverride())
1487  ? pListItem->GetNumRulesOverride()
1488  : pListBlock->GetNumRules() );
1489  nLevel = static_cast<sal_Int8>(pListBlock->GetLevel());
1490 
1491  if ( pListItem && pListItem->HasStartValue() ) {
1492  nStartValue = pListItem->GetStartValue();
1493  }
1494 
1495  // Inconsistent behavior regarding lists (#i92811#)
1496  sListId = m_xImpl->m_xTextListsHelper->GetListIdForListBlock(
1497  *pListBlock);
1498  }
1499  else if (pNumberedParagraph)
1500  {
1501  xNewNumRules.set(pNumberedParagraph->GetNumRules());
1502  nLevel = static_cast<sal_Int8>(pNumberedParagraph->GetLevel());
1503  sListId = pNumberedParagraph->GetListId();
1504  nStartValue = pNumberedParagraph->GetStartValue();
1505  }
1506 
1507 
1508  if (pListBlock || pNumberedParagraph)
1509  {
1510  // Assure that list style of automatic paragraph style is applied at paragraph. (#i101349#)
1511  bool bApplyNumRules = pStyle && pStyle->IsListStyleSet();
1512  if ( !bApplyNumRules )
1513  {
1514  bool bSameNumRules = xNewNumRules == xNumRules;
1515  if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
1516  {
1517  // If the interface pointers are different, then this does
1518  // not mean that the num rules are different. Further tests
1519  // are required then. However, if only one num rule is
1520  // set, no tests are required of course.
1521  Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
1522  Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
1523  if( xNewNamed.is() && xNamed.is() )
1524  {
1525  bSameNumRules = xNewNamed->getName() == xNamed->getName();
1526  }
1527  else
1528  {
1529  Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
1530  if( xNumRuleCompare.is() )
1531  {
1532  bSameNumRules = (xNumRuleCompare->compare( Any(xNumRules), Any(xNewNumRules) ) == 0);
1533  }
1534  }
1535  }
1536  bApplyNumRules = !bSameNumRules;
1537  }
1538 
1539  if ( bApplyNumRules )
1540  {
1541  // #102607# This may except when xNewNumRules contains
1542  // a Writer-NumRule-Implementation bug gets applied to
1543  // a shape. Since this may occur inside a document
1544  // (e.g. when edited), this must be handled
1545  // gracefully.
1546  try
1547  {
1548  xPropSet->setPropertyValue(
1549  s_NumberingRules, makeAny(xNewNumRules) );
1550  }
1551  catch(const Exception&)
1552  {
1553  ; // I would really like to use a warning here,
1554  // but I can't access the XMLErrorHandler from
1555  // here.
1556  }
1557  }
1558 
1559  if (!bNumberingIsNumber &&
1560  xPropSetInfo->hasPropertyByName(s_NumberingIsNumber))
1561  {
1562  xPropSet->setPropertyValue(s_NumberingIsNumber, Any(false));
1563  }
1564 
1565  xPropSet->setPropertyValue( s_NumberingLevel, Any(nLevel) );
1566 
1567  if( pListBlock && pListBlock->IsRestartNumbering() )
1568  {
1569  // TODO: property missing
1570  if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
1571  {
1572  xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
1573  makeAny(true) );
1574  }
1575  pListBlock->ResetRestartNumbering();
1576  }
1577 
1578  if ( 0 <= nStartValue &&
1579  xPropSetInfo->hasPropertyByName(s_NumberingStartValue))
1580  {
1581  xPropSet->setPropertyValue(s_NumberingStartValue,
1582  makeAny(nStartValue));
1583  }
1584 
1585  if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
1586  {
1587  if (!sListId.isEmpty()) {
1588  xPropSet->setPropertyValue(s_PropNameListId,
1589  makeAny(sListId) );
1590  }
1591  }
1592 
1593  GetTextListHelper().SetListItem( nullptr );
1594  }
1595  else
1596  {
1597  /* If the paragraph is not in a list but its style, remove it from
1598  the list. Do not remove it, if the list of the style is
1599  the chapter numbering rule.
1600  */
1601  if( xNumRules.is() )
1602  {
1603  bool bRemove( true );
1604  // Special handling for document from OOo 2.x (#i70748#)
1605  sal_Int32 nUPD( 0 );
1606  sal_Int32 nBuild( 0 );
1607  const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
1608  if ( ( bBuildIdFound && nUPD == 680 ) ||
1609  !pStyle || !pStyle->IsListStyleSet() )
1610  {
1611  if (m_xImpl->m_xChapterNumbering.is())
1612  {
1613  Reference< XNamed > xNumNamed( xNumRules, UNO_QUERY );
1614  Reference< XNamed > const xChapterNumNamed (
1615  m_xImpl->m_xChapterNumbering, UNO_QUERY);
1616  if ( xNumNamed.is() && xChapterNumNamed.is() &&
1617  xNumNamed->getName() == xChapterNumNamed->getName() )
1618  {
1619  bRemove = false;
1620  // RFE: inserting headings into text documents (#i70748#)
1621  bApplyOutlineLevelAsListLevel = true;
1622  }
1623  }
1624  }
1625  else
1626  {
1627  SAL_INFO_IF(!pStyle->GetListStyle().isEmpty(),
1628  "xmloff.text",
1629  "automatic paragraph style with list style name, but paragraph not in list???");
1630  }
1631  if ( bRemove )
1632  {
1633  xPropSet->setPropertyValue( s_NumberingRules, Any() );
1634  }
1635  }
1636  }
1637  }
1638 
1639  // hard paragraph properties
1640  if( pStyle )
1641  {
1642  pStyle->FillPropertySet( xPropSet );
1643  if( bPara && pStyle->HasMasterPageName() &&
1644  xPropSetInfo->hasPropertyByName(s_PageDescName))
1645  {
1646  OUString sDisplayName(
1647  rImport.GetStyleDisplayName(
1649  pStyle->GetMasterPageName()) );
1650  if( sDisplayName.isEmpty() ||
1651  (m_xImpl->m_xPageStyles.is() &&
1652  m_xImpl->m_xPageStyles->hasByName( sDisplayName)))
1653  {
1654  xPropSet->setPropertyValue(s_PageDescName,
1655  makeAny(sDisplayName));
1656  }
1657  }
1658  if( bPara && !pStyle->GetDropCapStyleName().isEmpty() &&
1659  m_xImpl->m_xTextStyles.is())
1660  {
1661  OUString sDisplayName(
1662  rImport.GetStyleDisplayName(
1664  pStyle->GetDropCapStyleName()) );
1665  if (m_xImpl->m_xTextStyles->hasByName(sDisplayName) &&
1666  xPropSetInfo->hasPropertyByName("DropCapCharStyleName"))
1667  {
1668  xPropSet->setPropertyValue("DropCapCharStyleName", makeAny(sDisplayName));
1669  }
1670  }
1671 
1672  // combined characters special treatment
1673  if (!bPara && pStyle->HasCombinedCharactersLetter())
1674  {
1675  // insert combined characters text field
1676  if (m_xImpl->m_xServiceFactory.is())
1677  {
1678  uno::Reference<beans::XPropertySet> const xTmp(
1679  m_xImpl->m_xServiceFactory->createInstance(
1680  "com.sun.star.text.TextField.CombinedCharacters"), UNO_QUERY);
1681  if( xTmp.is() )
1682  {
1683  // fix cursor if larger than possible for
1684  // combined characters field
1685  if (rCursor->getString().getLength() >
1687  {
1688  rCursor->gotoRange(rCursor->getStart(), false);
1689  rCursor->goRight(MAX_COMBINED_CHARACTERS, true);
1690  }
1691 
1692  // set field value (the combined character string)
1693  xTmp->setPropertyValue("Content",
1694  makeAny(rCursor->getString()));
1695 
1696  // insert the field over it's original text
1697  Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
1698  if (m_xImpl->m_xText.is() && rCursor.is())
1699  {
1700  // #i107225# the combined characters need to be inserted first
1701  // the selected text has to be removed afterwards
1702  m_xImpl->m_xText->insertTextContent( rCursor->getStart(), xTextContent, true );
1703 
1704  if( !rCursor->getString().isEmpty() )
1705  {
1706  try
1707  {
1708  uno::Reference< text::XTextCursor > xCrsr = rCursor->getText()->createTextCursorByRange( rCursor->getStart() );
1709  xCrsr->goLeft( 1, true );
1710  uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
1711  //the hard properties of the removed text need to be applied to the combined characters field
1712  pStyle->FillPropertySet( xCrsrProperties );
1713  xCrsr->collapseToEnd();
1714  xCrsr->gotoRange( rCursor->getEnd(), true );
1715  xCrsr->setString( OUString() );
1716  }
1717  catch(const uno::Exception&)
1718  {
1719  }
1720  }
1721  }
1722  }
1723  }
1724  }
1725  }
1726 
1727  // outline level; set after list style has been set
1728  // Complete re-worked and corrected: (#i53198#)
1729  // - set outline level at paragraph
1730  // - set numbering level at paragraph, if none is already set
1731  // - assure that style is marked as an outline style for the corresponding
1732  // outline level.
1733  // - DO NOT set type of numbering rule to outline.
1734  // - DO NOT set numbering rule directly at the paragraph.
1735 
1736  // Some minor rework and adjust access to paragraph styles (#i70748#)
1737  if ( bPara )
1738  {
1739  // Headings not numbered anymore in 3.1 (#i103817#)
1740  sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
1741  const bool bHasOutlineLevelProp(
1742  xPropSetInfo->hasPropertyByName(s_OutlineLevel));
1743  if ( bHasOutlineLevelProp )
1744  {
1745  xPropSet->getPropertyValue(s_OutlineLevel)
1746  >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
1747  }
1748  if ( nOutlineLevel > 0 )
1749  {
1750  if ( bHasOutlineLevelProp )
1751  {
1752  // In case that the value equals the value of its paragraph style
1753  // attribute outline level, the paragraph attribute value is left unset
1754  if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
1755  {
1756  xPropSet->setPropertyValue( s_OutlineLevel,
1757  makeAny( static_cast<sal_Int16>(nOutlineLevel) ) );
1758  }
1759  }
1760  if (!bOutlineContentVisible)
1761  {
1762  uno::Sequence<beans::PropertyValue> aGrabBag;
1763  xPropSet->getPropertyValue("ParaInteropGrabBag") >>= aGrabBag;
1764  sal_Int32 length = aGrabBag.getLength();
1765  aGrabBag.realloc(length + 1);
1766  aGrabBag[length].Name = "OutlineContentVisibleAttr";
1767  aGrabBag[length].Value <<= bool(bOutlineContentVisible);
1768  xPropSet->setPropertyValue("ParaInteropGrabBag", uno::makeAny(aGrabBag));
1769  }
1770  // RFE: inserting headings into text documents (#i70748#)
1771  if ( bApplyOutlineLevelAsListLevel )
1772  {
1773  sal_Int16 nNumLevel = -1;
1774  xPropSet->getPropertyValue( s_NumberingLevel ) >>= nNumLevel;
1775  if ( nNumLevel == -1 ||
1776  nNumLevel != (nOutlineLevel - 1) )
1777  {
1778  xPropSet->setPropertyValue( s_NumberingLevel,
1779  makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
1780  }
1781  }
1782  /* Correction: (#i69629#)
1783  - for text document from version OOo 2.0.4/SO 8 PU4 and earlier
1784  the paragraph style of a heading should be assigned to the
1785  corresponding list level of the outline style.
1786  - for other text documents the paragraph style of a heading is only
1787  a candidate for an assignment to the list level of the outline
1788  style, if it has no direct list style property and (if exists) the
1789  automatic paragraph style has also no direct list style set.
1790  */
1791  if (m_xImpl->m_xParaStyles.is() && m_xImpl->m_xParaStyles->hasByName(sStyleName))
1792  {
1793  bool bOutlineStyleCandidate( false );
1794 
1795  sal_Int32 nUPD( 0 );
1796  sal_Int32 nBuild( 0 );
1797  const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
1798  // Lost outline numbering in master document (#i73509#)
1799  // Check explicitly on certain versions (#i86058#)
1800  if ( rImport.IsTextDocInOOoFileFormat() ||
1801  ( bBuildIdFound &&
1802  ( nUPD == 645 || nUPD == 641 ) ) )
1803  {
1804  bOutlineStyleCandidate = true;
1805  }
1806  else if ( nUPD == 680 && nBuild <= 9073 ) /* BuildId of OOo 2.0.4/SO8 PU4 */
1807  {
1808  bOutlineStyleCandidate = bOutlineLevelAttrFound;
1809  }
1810  if ( bOutlineStyleCandidate )
1811  {
1812  AddOutlineStyleCandidate( nOutlineLevel, sStyleName );
1813  }
1814  // Assure that heading applies the outline style (#i103817#)
1815  if ( ( !pStyle || !pStyle->IsListStyleSet() ) &&
1816  !bOutlineStyleCandidate &&
1817  m_xImpl->m_xChapterNumbering.is())
1818  {
1819  if ( !lcl_HasListStyle( sStyleName,
1820  m_xImpl->m_xParaStyles, GetXMLImport(),
1821  u"NumberingStyleName",
1822  u"" ) )
1823  {
1824  // heading not in a list --> apply outline style
1825  xPropSet->setPropertyValue( s_NumberingRules,
1826  makeAny(m_xImpl->m_xChapterNumbering) );
1827  xPropSet->setPropertyValue( s_NumberingLevel,
1828  makeAny(static_cast<sal_Int8>(nOutlineLevel - 1)));
1829  }
1830  }
1831  }
1832  }
1833  //handle for text:p,if the paragraphstyle outlinelevel is set to[1~10]
1834  else if( bHasOutlineLevelProp )
1835  {
1836  if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
1837  {
1838  xPropSet->setPropertyValue(s_OutlineLevel,
1839  makeAny( sal_Int16(0) ));
1840  }
1841  }
1842  }
1843 
1844  return sStyleName;
1845 }
1846 
1848  sal_Int8 nOutlineLevel )
1849 {
1850  // style name empty?
1851  if( rStyleName.isEmpty() )
1852  {
1853  // Empty? Then we need o do stuff. Let's do error checking first.
1854  if (m_xImpl->m_xChapterNumbering.is() &&
1855  ( nOutlineLevel > 0 ) &&
1856  (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1857  {
1858  nOutlineLevel--; // for the remainder, the level's are 0-based
1859 
1860  // empty style name: look-up previously used name
1861 
1862  // if we don't have a previously used name, we'll use the default
1863  m_xImpl->InitOutlineStylesCandidates();
1864  if (m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].empty())
1865  {
1866  // no other name used previously? Then use default
1867 
1868  // iterate over property value sequence to find the style name
1869  Sequence<PropertyValue> aProperties;
1870  m_xImpl->m_xChapterNumbering->getByIndex( nOutlineLevel )
1871  >>= aProperties;
1872  auto pProp = std::find_if(aProperties.begin(), aProperties.end(),
1873  [](const PropertyValue& rProp) { return rProp.Name == "HeadingStyleName"; });
1874  if (pProp != aProperties.end())
1875  {
1876  OUString aOutlineStyle;
1877  pProp->Value >>= aOutlineStyle;
1878  m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel]
1879  .push_back( aOutlineStyle );
1880  }
1881  }
1882 
1883  // finally, we'll use the previously used style name for this
1884  // format (or the default we've just put into that style)
1885  // take last added one (#i71249#)
1886  rStyleName =
1887  m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].back();
1888  }
1889  // else: nothing we can do, so we'll leave it empty
1890  }
1891  // else: we already had a style name, so we let it pass.
1892 }
1893 
1895  const OUString& rStyleName )
1896 {
1897  if (!rStyleName.isEmpty()
1898  && m_xImpl->m_xChapterNumbering.is()
1899  && (nOutlineLevel > 0)
1900  && (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1901  {
1902  m_xImpl->InitOutlineStylesCandidates();
1903  m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel-1].push_back(
1904  rStyleName);
1905  }
1906 }
1907 
1908 void XMLTextImportHelper::SetOutlineStyles( bool bSetEmptyLevels )
1909 {
1910  if (!(m_xImpl->m_xOutlineStylesCandidates != nullptr || bSetEmptyLevels) ||
1911  !m_xImpl->m_xChapterNumbering.is() ||
1912  IsInsertMode())
1913  return;
1914 
1915  bool bChooseLastOne( false );
1916  {
1917  if ( GetXMLImport().IsTextDocInOOoFileFormat() )
1918  {
1919  bChooseLastOne = true;
1920  }
1921  else
1922  {
1923  sal_Int32 nUPD( 0 );
1924  sal_Int32 nBuild( 0 );
1925  if ( GetXMLImport().getBuildIds( nUPD, nBuild ) )
1926  {
1927  // check explicitly on certain versions
1928  bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
1929  ( nUPD == 680 && nBuild <= 9073 ); // OOo 2.0 - OOo 2.0.4
1930  }
1931  }
1932  }
1933 
1934  OUString sOutlineStyleName;
1935  {
1936  Reference<XPropertySet> xChapterNumRule(
1937  m_xImpl->m_xChapterNumbering, UNO_QUERY);
1938  xChapterNumRule->getPropertyValue("Name") >>= sOutlineStyleName;
1939  }
1940 
1941  const sal_Int32 nCount = m_xImpl->m_xChapterNumbering->getCount();
1942  /* First collect all paragraph styles chosen for assignment to each
1943  list level of the outline style, then perform the intrinsic assignment.
1944  Reason: The assignment of a certain paragraph style to a list level
1945  of the outline style causes side effects on the children
1946  paragraph styles in Writer. (#i106218#)
1947  */
1948  ::std::vector<OUString> sChosenStyles(nCount);
1949  for( sal_Int32 i=0; i < nCount; ++i )
1950  {
1951  if ( bSetEmptyLevels ||
1952  (m_xImpl->m_xOutlineStylesCandidates &&
1953  !m_xImpl->m_xOutlineStylesCandidates[i].empty()))
1954  {
1955  // determine, which candidate is one to be assigned to the list
1956  // level of the outline style
1957  if (m_xImpl->m_xOutlineStylesCandidates &&
1958  !m_xImpl->m_xOutlineStylesCandidates[i].empty())
1959  {
1960  if ( bChooseLastOne )
1961  {
1962  sChosenStyles[i] =
1963  m_xImpl->m_xOutlineStylesCandidates[i].back();
1964  }
1965  else
1966  {
1967  for (size_t j = 0;
1968  j < m_xImpl->m_xOutlineStylesCandidates[i].size();
1969  ++j)
1970  {
1971  if (!lcl_HasListStyle(
1972  m_xImpl->m_xOutlineStylesCandidates[i][j],
1973  m_xImpl->m_xParaStyles,
1974  GetXMLImport(),
1975  "NumberingStyleName",
1976  sOutlineStyleName))
1977  {
1978  sChosenStyles[i] =
1979  m_xImpl->m_xOutlineStylesCandidates[i][j];
1980  break;
1981  }
1982  }
1983  }
1984  }
1985  }
1986  }
1987  // Trashed outline numbering in ODF 1.1 text document created by OOo 3.x (#i106218#)
1988  Sequence < PropertyValue > aProps( 1 );
1989  PropertyValue *pProps = aProps.getArray();
1990  pProps->Name = "HeadingStyleName";
1991  for ( sal_Int32 i = 0; i < nCount; ++i )
1992  {
1993  // Paragraph style assignments in Outline of template lost from second level on (#i107610#)
1994  if ( bSetEmptyLevels || !sChosenStyles[i].isEmpty() )
1995  {
1996  pProps->Value <<= sChosenStyles[i];
1997  m_xImpl->m_xChapterNumbering->replaceByIndex(i,
1998  makeAny( aProps ));
1999  }
2000  }
2001 
2002 }
2003 
2005  SvXMLImport const & rImport,
2006  const Reference < XTextCursor >& rCursor,
2007  const OUString& rHRef,
2008  const OUString& rName,
2009  const OUString& rTargetFrameName,
2010  const OUString& rStyleName,
2011  const OUString& rVisitedStyleName,
2012  XMLEventsImportContext* pEvents)
2013 {
2014  static const char s_HyperLinkURL[] = "HyperLinkURL";
2015  static const char s_HyperLinkName[] = "HyperLinkName";
2016  static const char s_HyperLinkTarget[] = "HyperLinkTarget";
2017  static const char s_UnvisitedCharStyleName[] = "UnvisitedCharStyleName";
2018  static const char s_VisitedCharStyleName[] = "VisitedCharStyleName";
2019  static const char s_HyperLinkEvents[] = "HyperLinkEvents";
2020 
2021  Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
2022  Reference < XPropertySetInfo > xPropSetInfo(
2023  xPropSet->getPropertySetInfo());
2024  if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
2025  return;
2026 
2027  xPropSet->setPropertyValue(s_HyperLinkURL, makeAny(rHRef));
2028 
2029  if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
2030  {
2031  xPropSet->setPropertyValue(s_HyperLinkName, makeAny(rName));
2032  }
2033 
2034  if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
2035  {
2036  xPropSet->setPropertyValue(s_HyperLinkTarget,
2037  makeAny(rTargetFrameName));
2038  }
2039 
2040  if ( (pEvents != nullptr) &&
2041  xPropSetInfo->hasPropertyByName(s_HyperLinkEvents))
2042  {
2043  // The API treats events at hyperlinks differently from most
2044  // other properties: You have to set a name replace with the
2045  // events in it. The easiest way to do this is to 1) get
2046  // events, 2) set new ones, and 3) then put events back.
2047  uno::Reference<XNameReplace> const xReplace(
2048  xPropSet->getPropertyValue(s_HyperLinkEvents), UNO_QUERY);
2049  if (xReplace.is())
2050  {
2051  // set events
2052  pEvents->SetEvents(xReplace);
2053 
2054  // put events
2055  xPropSet->setPropertyValue(s_HyperLinkEvents, makeAny(xReplace));
2056  }
2057  }
2058 
2059  if (m_xImpl->m_xTextStyles.is())
2060  {
2061  OUString sDisplayName(
2062  rImport.GetStyleDisplayName(
2063  XmlStyleFamily::TEXT_TEXT, rStyleName ) );
2064  if( !sDisplayName.isEmpty() &&
2065  xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
2066  m_xImpl->m_xTextStyles->hasByName(sDisplayName))
2067  {
2068  xPropSet->setPropertyValue(s_UnvisitedCharStyleName,
2070  }
2071 
2072  sDisplayName =
2073  rImport.GetStyleDisplayName(
2074  XmlStyleFamily::TEXT_TEXT, rVisitedStyleName );
2075  if( !sDisplayName.isEmpty() &&
2076  xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
2077  m_xImpl->m_xTextStyles->hasByName(sDisplayName))
2078  {
2079  xPropSet->setPropertyValue(s_VisitedCharStyleName,
2081  }
2082  }
2083 }
2084 
2086  SvXMLImport const & rImport,
2087  const Reference < XTextCursor >& rCursor,
2088  const OUString& rStyleName,
2089  const OUString& rTextStyleName,
2090  const OUString& rText )
2091 {
2092  Reference<XPropertySet> xPropSet(rCursor, UNO_QUERY);
2093 
2094  OUString sRubyText("RubyText");
2095 
2096  // if we have one Ruby property, we assume all of them are present
2097  if (xPropSet.is() &&
2098  xPropSet->getPropertySetInfo()->hasPropertyByName( sRubyText ))
2099  {
2100  // the ruby text
2101  xPropSet->setPropertyValue(sRubyText, makeAny(rText));
2102 
2103  // the ruby style (ruby-adjust)
2104  if (!rStyleName.isEmpty() && m_xImpl->m_xAutoStyles.is())
2105  {
2106  const SvXMLStyleContext* pTempStyle =
2107  m_xImpl->m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::TEXT_RUBY,
2108  rStyleName, true );
2109  XMLPropStyleContext *pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
2110 
2111  if (nullptr != pStyle)
2112  pStyle->FillPropertySet( xPropSet );
2113  }
2114 
2115  // the ruby text character style
2116  if (m_xImpl->m_xTextStyles.is())
2117  {
2118  OUString sDisplayName(
2119  rImport.GetStyleDisplayName(
2120  XmlStyleFamily::TEXT_TEXT, rTextStyleName ) );
2121  if( (!sDisplayName.isEmpty()) &&
2122  m_xImpl->m_xTextStyles->hasByName( sDisplayName ))
2123  {
2124  xPropSet->setPropertyValue("RubyCharStyleName", makeAny(sDisplayName));
2125  }
2126  }
2127  }
2128 }
2129 
2131 {
2132  m_xImpl->m_xAutoStyles = pStyles;
2133 }
2134 
2136  SvXMLImport& rImport,
2137  sal_uInt16 nPrefix, const OUString& rLocalName,
2138  const Reference< XAttributeList > & xAttrList,
2139  XMLTextType eType )
2140 {
2141  SvXMLImportContext *pContext = nullptr;
2142 
2143  const SvXMLTokenMap& rTokenMap = GetTextElemTokenMap();
2144  bool bHeading = false;
2145  bool bContent = true;
2146  sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
2147  switch( nToken )
2148  {
2149  case XML_TOK_TEXT_H:
2150  bHeading = true;
2151  [[fallthrough]];
2152  case XML_TOK_TEXT_P:
2153  pContext = new XMLParaContext( rImport,
2154  nPrefix, rLocalName,
2155  xAttrList, bHeading );
2156  if (m_xImpl->m_bProgress && XMLTextType::Shape != eType)
2157  {
2158  rImport.GetProgressBarHelper()->Increment();
2159  }
2160  break;
2162  pContext = new XMLNumberedParaContext(
2163  rImport, nPrefix, rLocalName, xAttrList );
2164  break;
2165  case XML_TOK_TEXT_LIST:
2166  pContext = new XMLTextListBlockContext( rImport, *this,
2167  nPrefix, rLocalName,
2168  xAttrList );
2169  break;
2170  case XML_TOK_TABLE_TABLE:
2171  if( XMLTextType::Body == eType ||
2172  XMLTextType::TextBox == eType ||
2173  XMLTextType::Section == eType ||
2174  XMLTextType::HeaderFooter == eType ||
2175  XMLTextType::ChangedRegion == eType ||
2176  XMLTextType::Cell == eType )
2177  pContext = CreateTableChildContext( rImport, nPrefix, rLocalName,
2178  xAttrList );
2179  break;
2181  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2182  XMLTextType::HeaderFooter == eType )
2183  {
2184  pContext = new XMLVariableDeclsImportContext(
2185  rImport, *this, nPrefix, rLocalName, VarTypeSequence);
2186  bContent = false;
2187  }
2188  break;
2189 
2191  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2192  XMLTextType::HeaderFooter == eType )
2193  {
2194  pContext = new XMLVariableDeclsImportContext(
2195  rImport, *this, nPrefix, rLocalName, VarTypeSimple);
2196  bContent = false;
2197  }
2198  break;
2199 
2201  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted)||
2202  XMLTextType::HeaderFooter == eType )
2203  {
2204  pContext = new XMLVariableDeclsImportContext(
2205  rImport, *this, nPrefix, rLocalName, VarTypeUserField);
2206  bContent = false;
2207  }
2208  break;
2209 
2211  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2212  XMLTextType::HeaderFooter == eType )
2213  {
2214  pContext = new XMLDdeFieldDeclsImportContext(
2215  rImport, nPrefix, rLocalName);
2216  bContent = false;
2217  }
2218  break;
2219 
2221  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2222  XMLTextType::TextBox == eType ||
2223  XMLTextType::ChangedRegion == eType )
2224  {
2225  TextContentAnchorType eAnchorType =
2226  XMLTextType::TextBox == eType ? TextContentAnchorType_AT_FRAME
2227  : TextContentAnchorType_AT_PAGE;
2228  pContext = new XMLTextFrameContext( rImport, nPrefix,
2229  rLocalName, xAttrList,
2230  eAnchorType );
2231  bContent = false;
2232  }
2233  break;
2234 
2235  case XML_TOK_DRAW_A_PAGE:
2236  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2237  XMLTextType::TextBox == eType ||
2238  XMLTextType::ChangedRegion == eType)
2239  {
2240  TextContentAnchorType eAnchorType =
2241  XMLTextType::TextBox == eType ? TextContentAnchorType_AT_FRAME
2242  : TextContentAnchorType_AT_PAGE;
2243  pContext = new XMLTextFrameHyperlinkContext( rImport, nPrefix,
2244  rLocalName, xAttrList,
2245  eAnchorType );
2246  bContent = false;
2247  }
2248  break;
2249 
2251  case XML_TOK_TEXT_SECTION:
2252  pContext = new XMLSectionImportContext( rImport, nPrefix, rLocalName );
2253  break;
2254 
2255  case XML_TOK_TEXT_TOC:
2262  if( XMLTextType::Shape != eType )
2263  pContext = new XMLIndexTOCContext( rImport, nPrefix, rLocalName );
2264  break;
2265 
2267  pContext = new XMLTrackedChangesImportContext( rImport, nPrefix,
2268  rLocalName);
2269  bContent = false;
2270  break;
2271 
2272  case XML_TOK_TEXT_CHANGE:
2275  pContext = new XMLChangeImportContext(
2276  rImport, nPrefix, rLocalName,
2277  ((nToken == XML_TOK_TEXT_CHANGE_END)
2279  : (nToken == XML_TOK_TEXT_CHANGE_START)
2282  true);
2283  break;
2284 
2285  case XML_TOK_TEXT_FORMS:
2287  bContent = false;
2288  break;
2289 
2290  case XML_TOK_TEXT_AUTOMARK:
2291  if( XMLTextType::Body == eType )
2292  {
2293  pContext = new XMLAutoMarkFileContext(rImport, nPrefix,rLocalName);
2294  }
2295  bContent = false;
2296  break;
2297 
2299  pContext = new XMLCalculationSettingsContext ( rImport, nPrefix, rLocalName, xAttrList);
2300  bContent = false;
2301  break;
2302 
2303  default:
2304  if ((XMLTextType::Body == eType && m_xImpl->m_bBodyContentStarted) ||
2305  XMLTextType::TextBox == eType ||
2306  XMLTextType::ChangedRegion == eType )
2307  {
2308  Reference < XShapes > xShapes;
2309  pContext = rImport.GetShapeImport()->CreateGroupChildContext(
2310  rImport, nPrefix, rLocalName, xAttrList, xShapes );
2311  bContent = false;
2312  }
2313  }
2314 
2315  // handle open redlines
2316  if ( (XML_TOK_TEXT_CHANGE != nToken) &&
2317  (XML_TOK_TEXT_CHANGE_END != nToken) &&
2318  (XML_TOK_TEXT_CHANGE_START != nToken) )
2319  {
2320 // ResetOpenRedlineId();
2321  }
2322 
2323  if( XMLTextType::Body == eType && bContent )
2324  {
2325  m_xImpl->m_bBodyContentStarted = false;
2326  }
2327 
2328  if( nToken != XML_TOK_TEXT_FRAME_PAGE )
2330  return pContext;
2331 }
2332 
2334  SvXMLImport&,
2335  sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/,
2336  const Reference< XAttributeList > & )
2337 {
2338  return nullptr;
2339 }
2340 
2342 sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
2343  bool* pIsSystemLanguage )
2344 {
2345  if (!m_xImpl->m_xAutoStyles.is())
2346  return -1;
2347 
2348  const SvXMLStyleContext* pStyle =
2349  m_xImpl->m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::DATA_STYLE,
2350  sStyleName, true );
2351 
2352  // get appropriate context
2353 
2354 
2355  // first check if it's an Impress and draw only number format
2356  // this is needed since it's also a SvXMLNumFormatContext,
2357  // that was needed to support them for controls in impress/draw also
2358  const SdXMLNumberFormatImportContext* pSdNumStyle = dynamic_cast<const SdXMLNumberFormatImportContext*>( pStyle );
2359  if( pSdNumStyle )
2360  {
2361  return pSdNumStyle->GetDrawKey();
2362  }
2363  else
2364  {
2365  SvXMLNumFormatContext* pNumStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast<const SvXMLNumFormatContext*>( pStyle ) );
2366  if( pNumStyle )
2367  {
2368  if( pIsSystemLanguage != nullptr )
2369  *pIsSystemLanguage = pNumStyle->IsSystemLanguage();
2370 
2371  // return key
2372  return pNumStyle->GetKey();
2373  }
2374  }
2375  return -1;
2376 }
2377 
2379 {
2380  const SvxXMLListStyleContext *pStyle = nullptr;
2381  if (m_xImpl->m_xAutoStyles.is())
2382  {
2383  const SvXMLStyleContext* pTempStyle =
2384  m_xImpl->m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::TEXT_LIST, rName,
2385  true );
2386  pStyle = dynamic_cast< const SvxXMLListStyleContext* >(pTempStyle);
2387  }
2388 
2389  return pStyle;
2390 }
2391 
2393 {
2394  XMLPropStyleContext *pStyle = nullptr;
2395  if (m_xImpl->m_xAutoStyles.is())
2396  {
2397  const SvXMLStyleContext* pTempStyle =
2398  m_xImpl->m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::SD_GRAPHICS_ID, rName,
2399  true );
2400  pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
2401  }
2402 
2403  return pStyle;
2404 }
2405 
2407  const OUString& rName ) const
2408 {
2409  XMLPropStyleContext* pStyle = nullptr;
2410  if (m_xImpl->m_xAutoStyles.is())
2411  {
2412  const SvXMLStyleContext* pTempStyle =
2413  m_xImpl->m_xAutoStyles->FindStyleChildContext(
2415  rName, true );
2416  pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
2417  }
2418 
2419  return pStyle;
2420 }
2421 
2423  const OUString& rName ) const
2424 {
2425  XMLPropStyleContext* pStyle = nullptr;
2426  if (m_xImpl->m_xAutoStyles.is())
2427  {
2428  const SvXMLStyleContext* pTempStyle =
2429  m_xImpl->m_xAutoStyles->FindStyleChildContext(
2431  rName, true );
2432  pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
2433  }
2434 
2435  return pStyle;
2436 }
2437 
2439 {
2440  if (!m_xImpl->m_xAutoStyles.is())
2441  {
2442  return nullptr;
2443  }
2444  SvXMLStyleContext const* pStyle(
2445  m_xImpl->m_xAutoStyles->FindStyleChildContext(
2446  XmlStyleFamily::SD_DRAWINGPAGE_ID, rName, true));
2447  assert(pStyle == nullptr || dynamic_cast<XMLPropStyleContext const*>(pStyle) != nullptr);
2448  return const_cast<XMLPropStyleContext*>(static_cast<XMLPropStyleContext const*>(pStyle));
2449 }
2450 
2452 {
2453  GetTextListHelper().PushListContext(static_cast<XMLTextListBlockContext*>(nullptr));
2454 }
2455 
2457 {
2459 }
2460 
2461 
2463 {
2464  if (!m_xImpl->m_xTextNumberedParagraphAttrTokenMap)
2465  {
2466  m_xImpl->m_xTextNumberedParagraphAttrTokenMap.reset(
2467  new SvXMLTokenMap( aTextNumberedParagraphAttrTokenMap ) );
2468  }
2469  return *m_xImpl->m_xTextNumberedParagraphAttrTokenMap;
2470 }
2471 
2473 {
2474  if (!m_xImpl->m_xTextListBlockAttrTokenMap)
2475  {
2476  m_xImpl->m_xTextListBlockAttrTokenMap.reset(
2477  new SvXMLTokenMap( aTextListBlockAttrTokenMap ) );
2478  }
2479  return *m_xImpl->m_xTextListBlockAttrTokenMap;
2480 }
2481 
2483 {
2484  if (!m_xImpl->m_xTextListBlockElemTokenMap)
2485  {
2486  m_xImpl->m_xTextListBlockElemTokenMap.reset(
2487  new SvXMLTokenMap( aTextListBlockElemTokenMap ) );
2488  }
2489  return *m_xImpl->m_xTextListBlockElemTokenMap;
2490 }
2491 
2493 {
2494  if (!m_xImpl->m_xRenameMap)
2495  {
2496  m_xImpl->m_xRenameMap.reset( new SvI18NMap );
2497  }
2498  return *m_xImpl->m_xRenameMap;
2499 }
2500 
2502  const OUString & sName,
2503  const Reference<XTextRange> & rRange,
2504  OUString const& i_rXmlId,
2505  std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
2506 {
2507  m_xImpl->m_BookmarkStartRanges[sName] =
2508  std::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
2509  m_xImpl->m_BookmarkVector.push_back(sName);
2510 }
2511 
2513  const OUString & sName,
2514  Reference<XTextRange> & o_rRange,
2515  OUString & o_rXmlId,
2516  std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
2517 {
2518  if (m_xImpl->m_BookmarkStartRanges.count(sName))
2519  {
2520  Impl::BookmarkMapEntry_t & rEntry =
2521  (*m_xImpl->m_BookmarkStartRanges.find(sName)).second;
2522  o_rRange.set(std::get<0>(rEntry));
2523  o_rXmlId = std::get<1>(rEntry);
2524  o_rpRDFaAttributes = std::get<2>(rEntry);
2525  m_xImpl->m_BookmarkStartRanges.erase(sName);
2526  auto it = std::find(m_xImpl->m_BookmarkVector.begin(), m_xImpl->m_BookmarkVector.end(), sName);
2527  if (it!=m_xImpl->m_BookmarkVector.end())
2528  {
2529  m_xImpl->m_BookmarkVector.erase(it);
2530  }
2531  return true;
2532  }
2533  else
2534  {
2535  return false;
2536  }
2537 }
2538 
2539 void XMLTextImportHelper::pushFieldCtx( const OUString& name, const OUString& type )
2540 {
2541  m_xImpl->m_FieldStack.push(Impl::field_stack_item_t(
2542  Impl::field_name_type_t(name, type), Impl::field_params_t(), uno::Reference<text::XFormField>{}));
2543 }
2544 
2545 uno::Reference<text::XFormField>
2547 {
2548  uno::Reference<text::XFormField> xRet;
2549  if ( !m_xImpl->m_FieldStack.empty() )
2550  {
2551  xRet = std::get<2>(m_xImpl->m_FieldStack.top());
2552  m_xImpl->m_FieldStack.pop();
2553  }
2554  else
2555  {
2556  SAL_INFO("xmloff.text", "unexpected fieldmark end");
2557  }
2558  return xRet;
2559 }
2560 
2561 void XMLTextImportHelper::addFieldParam( const OUString& name, const OUString& value )
2562 {
2563  assert(!m_xImpl->m_FieldStack.empty());
2564  if (!m_xImpl->m_FieldStack.empty()) {
2565  Impl::field_stack_item_t & FieldStackItem(m_xImpl->m_FieldStack.top());
2566  std::get<1>(FieldStackItem).emplace_back( name, value );
2567  }
2568 }
2569 
2571 {
2572  assert(!m_xImpl->m_FieldStack.empty());
2573  if (!m_xImpl->m_FieldStack.empty())
2574  {
2575  return std::get<0>(m_xImpl->m_FieldStack.top()).second;
2576  }
2577  else
2578  {
2579  return OUString();
2580  }
2581 }
2582 
2584 {
2585  return !m_xImpl->m_FieldStack.empty();
2586 }
2587 
2588 void XMLTextImportHelper::setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField> const &xFormField)
2589 {
2590  assert(!m_xImpl->m_FieldStack.empty());
2591  if (!m_xImpl->m_FieldStack.empty() && xFormField.is())
2592  {
2593  FieldParamImporter(&std::get<1>(m_xImpl->m_FieldStack.top()),
2594  xFormField->getParameters()).Import();
2595  std::get<2>(m_xImpl->m_FieldStack.top()) = xFormField;
2596  }
2597 }
2598 
2599 
2601  const OUString& rFrmName,
2602  const OUString& rNextFrmName,
2603  const Reference < XPropertySet >& rFrmPropSet )
2604 {
2605  if( rFrmName.isEmpty() )
2606  return;
2607 
2608  if( !rNextFrmName.isEmpty() )
2609  {
2610  OUString sNextFrmName(GetRenameMap().Get( XML_TEXT_RENAME_TYPE_FRAME,
2611  rNextFrmName ));
2612  if (m_xImpl->m_xTextFrames.is()
2613  && m_xImpl->m_xTextFrames->hasByName(sNextFrmName))
2614  {
2615  rFrmPropSet->setPropertyValue("ChainNextName",
2616  makeAny(sNextFrmName));
2617  }
2618  else
2619  {
2620  if (!m_xImpl->m_xPrevFrmNames)
2621  {
2622  m_xImpl->m_xPrevFrmNames.reset( new std::vector<OUString> );
2623  m_xImpl->m_xNextFrmNames.reset( new std::vector<OUString> );
2624  }
2625  m_xImpl->m_xPrevFrmNames->push_back(rFrmName);
2626  m_xImpl->m_xNextFrmNames->push_back(sNextFrmName);
2627  }
2628  }
2629  if (m_xImpl->m_xPrevFrmNames && !m_xImpl->m_xPrevFrmNames->empty())
2630  {
2631  for(std::vector<OUString>::iterator i = m_xImpl->m_xPrevFrmNames->begin(), j = m_xImpl->m_xNextFrmNames->begin(); i != m_xImpl->m_xPrevFrmNames->end() && j != m_xImpl->m_xNextFrmNames->end(); ++i, ++j)
2632  {
2633  if((*j) == rFrmName)
2634  {
2635  // The previous frame must exist, because it existing than
2636  // inserting the entry
2637  rFrmPropSet->setPropertyValue("ChainPrevName", makeAny(*i));
2638 
2639  i = m_xImpl->m_xPrevFrmNames->erase(i);
2640  j = m_xImpl->m_xNextFrmNames->erase(j);
2641 
2642  // There cannot be more than one previous frames
2643  break;
2644  }
2645  }
2646  }
2647 }
2648 
2650 {
2651  static const char s_TextFrame[] = "TextFrame";
2652 
2653  bool bIsInFrame = false;
2654 
2655  // are we currently in a text frame? yes, if the cursor has a
2656  // TextFrame property and it's non-NULL
2657  Reference<XPropertySet> xPropSet(const_cast<XMLTextImportHelper*>(this)->GetCursor(), UNO_QUERY);
2658  if (xPropSet.is())
2659  {
2660  if (xPropSet->getPropertySetInfo()->hasPropertyByName(s_TextFrame))
2661  {
2662  uno::Reference<XTextFrame> const xFrame(
2663  xPropSet->getPropertyValue(s_TextFrame), UNO_QUERY);
2664 
2665  if (xFrame.is())
2666  {
2667  bIsInFrame = true;
2668  }
2669  }
2670  }
2671 
2672  return bIsInFrame;
2673 }
2674 
2676 {
2677  return false;
2678 }
2679 
2681  SvXMLImport&,
2682  const OUString& /*rHRef*/,
2683  const OUString& /*rStyleName*/,
2684  const OUString& /*rTblName*/,
2685  sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
2686 {
2687  Reference< XPropertySet> xPropSet;
2688  return xPropSet;
2689 }
2690 
2692  SvXMLImport&,
2693  const OUString& /*rHRef*/,
2694  const OUString& /*rStyleName*/,
2695  const OUString& /*rTblName*/,
2696  sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
2697 {
2698  Reference< XPropertySet> xPropSet;
2699  return xPropSet;
2700 }
2701 
2703  const OUString& /*rCode*/,
2704  const OUString& /*rName*/,
2705  bool /*bMayScript*/,
2706  const OUString& /*rHRef*/,
2707  sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
2708 {
2709  Reference< XPropertySet> xPropSet;
2710  return xPropSet;
2711 }
2713  const OUString& /*rMimeType*/,
2714  const OUString& /*rHRef*/,
2715  sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
2716 {
2717  Reference< XPropertySet> xPropSet;
2718  return xPropSet;
2719 }
2721  const OUString& /*rName*/,
2722  const OUString& /*rHRef*/,
2723  const OUString& /*rStyleName*/,
2724  sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
2725 {
2726  Reference< XPropertySet> xPropSet;
2727  return xPropSet;
2728 }
2729 
2731  const Reference < XPropertySet> &,
2732  std::map < const OUString, OUString > &)
2733 {
2734 }
2735 // redline helper: dummy implementation to be overridden in sw/filter/xml
2736 void XMLTextImportHelper::RedlineAdd( const OUString& /*rType*/,
2737  const OUString& /*rId*/,
2738  const OUString& /*rAuthor*/,
2739  const OUString& /*rComment*/,
2740  const util::DateTime& /*rDateTime*/,
2741  bool /*bMergeLastPara*/)
2742 {
2743  // dummy implementation: do nothing
2744 }
2745 
2747  Reference<XTextCursor> & /*rOldCursor*/,
2748  const OUString& /*rId*/)
2749 {
2750  // dummy implementation: do nothing
2751  Reference<XTextCursor> xRet;
2752  return xRet;
2753 }
2754 
2756  const OUString& /*rId*/,
2757  bool /*bStart*/,
2758  bool /*bIsOutsideOfParagraph*/)
2759 {
2760  // dummy implementation: do nothing
2761 }
2762 
2764 {
2765  // dummy implementation: do nothing
2766 }
2767 
2769 {
2770  // dummy implementation: do nothing
2771 }
2772 
2774 {
2775  // dummy implementation: do nothing
2776 }
2777 void XMLTextImportHelper::SetChangesProtectionKey(const Sequence<sal_Int8> &)
2778 {
2779  // dummy implementation: do nothing
2780 }
2781 
2782 
2784 {
2785  return m_xImpl->m_sOpenRedlineIdentifier;
2786 }
2787 
2788 void XMLTextImportHelper::SetOpenRedlineId( OUString const & rId)
2789 {
2790  m_xImpl->m_sOpenRedlineIdentifier = rId;
2791 }
2792 
2794 {
2795  SetOpenRedlineId("");
2796 }
2797 
2798 void
2800 {
2801  m_xImpl->m_sCellParaStyleDefault = rNewValue;
2802 }
2803 
2805 {
2806  return m_xImpl->m_sCellParaStyleDefault;
2807 }
2808 
2809 void XMLTextImportHelper::AddCrossRefHeadingMapping(OUString const& rFrom, OUString const& rTo)
2810 {
2811  if (!m_xImpl->m_pCrossRefHeadingBookmarkMap)
2812  {
2813  m_xImpl->m_pCrossRefHeadingBookmarkMap.reset(new std::map<OUString, OUString>);
2814  }
2815  m_xImpl->m_pCrossRefHeadingBookmarkMap->insert(std::make_pair(rFrom, rTo));
2816 }
2817 
2818 // tdf#94804: hack to map cross reference fields that reference duplicate marks
2819 // note that we can't really check meta:generator for this since the file might
2820 // be round-tripped by different versions preserving duplicates => always map
2822 {
2823  if (!m_xImpl->m_pCrossRefHeadingBookmarkMap)
2824  {
2825  return;
2826  }
2827 
2828  uno::Reference<text::XTextFieldsSupplier> const xFieldsSupplier(
2829  m_xImpl->m_rSvXMLImport.GetModel(), uno::UNO_QUERY);
2830  if (!xFieldsSupplier.is())
2831  {
2832  return;
2833  }
2834  uno::Reference<container::XEnumerationAccess> const xFieldsEA(
2835  xFieldsSupplier->getTextFields());
2836  uno::Reference<container::XEnumeration> const xFields(
2837  xFieldsEA->createEnumeration());
2838  while (xFields->hasMoreElements())
2839  {
2840  uno::Reference<lang::XServiceInfo> const xFieldInfo(
2841  xFields->nextElement(), uno::UNO_QUERY);
2842  if (!xFieldInfo->supportsService("com.sun.star.text.textfield.GetReference"))
2843  {
2844  continue;
2845  }
2846  uno::Reference<beans::XPropertySet> const xField(
2847  xFieldInfo, uno::UNO_QUERY);
2848  sal_uInt16 nType(0);
2849  xField->getPropertyValue("ReferenceFieldSource") >>= nType;
2850  if (text::ReferenceFieldSource::BOOKMARK != nType)
2851  {
2852  continue;
2853  }
2854  OUString name;
2855  xField->getPropertyValue("SourceName") >>= name;
2856  auto const iter(m_xImpl->m_pCrossRefHeadingBookmarkMap->find(name));
2857  if (iter == m_xImpl->m_pCrossRefHeadingBookmarkMap->end())
2858  {
2859  continue;
2860  }
2861  xField->setPropertyValue("SourceName", uno::makeAny(iter->second));
2862  }
2863 }
2864 
2865 void XMLTextImportHelper::setBookmarkAttributes(OUString const& bookmark, bool hidden, OUString const& condition)
2866 {
2867  m_xImpl->m_bBookmarkHidden[bookmark] = hidden;
2868  m_xImpl->m_sBookmarkCondition[bookmark] = condition;
2869 }
2870 
2871 bool XMLTextImportHelper::getBookmarkHidden(OUString const& bookmark) const
2872 {
2873  return m_xImpl->m_bBookmarkHidden[bookmark];
2874 }
2875 
2876 const OUString& XMLTextImportHelper::getBookmarkCondition(OUString const& bookmark) const
2877 {
2878  return m_xImpl->m_sBookmarkCondition[bookmark];
2879 }
2880 
2881 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::container::XIndexReplace > & GetNumRulesOverride() const
virtual void SetShowChanges(bool bShowChanges)
Definition: txtimp.cxx:2768
bool IsOrganizerMode() const
Definition: txtimp.cxx:573
bool IsBlockMode() const
Definition: txtimp.cxx:568
#define XML_TEXT_RENAME_TYPE_FRAME
Definition: txtimp.hxx:351
static SvXMLImportPropertyMapper * CreateShapeExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:943
void SetInsideDeleteContext(bool const bNew)
redlining : Setter to remember the fact we are inside/outside a element (deleted redl...
Definition: txtimp.cxx:649
bool m_bInsideDeleteContext
Are we inside a element (deleted redline section)
Definition: txtimp.cxx:495
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
css::uno::Reference< css::text::XTextCursor > & GetCursor()
Definition: txtimp.cxx:548
uno::Reference< text::XText > m_xText
Definition: txtimp.cxx:470
SvXMLTokenMap const & GetTextPElemTokenMap()
Definition: txtimp.cxx:679
std::unique_ptr< Impl > m_xImpl
Definition: txtimp.hxx:360
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight)
Definition: txtimp.cxx:2712
void AddCrossRefHeadingMapping(OUString const &rFrom, OUString const &rTo)
Definition: txtimp.cxx:2809
void SetEvents(const css::uno::Reference< css::document::XEventsSupplier > &xEventsSupplier)
if the import operates in delayed mode, you can use this method to set all events that have been read...
virtual css::uno::Reference< css::text::XTextCursor > RedlineCreateText(css::uno::Reference< css::text::XTextCursor > &rOldCursor, const OUString &rId)
Definition: txtimp.cxx:2746
Import all indices.
XMLPropStyleContext * FindDrawingPage(OUString const &rName) const
Definition: txtimp.cxx:2438
signed char sal_Int8
XMLPropStyleContext * FindSectionStyle(const OUString &rName) const
Definition: txtimp.cxx:2406
rtl::Reference< SvXMLImportPropertyMapper > m_xParaImpPrMap
Definition: txtimp.cxx:434
const SvXMLTokenMapEntry aTextListBlockElemTokenMap[]
Definition: txtimp.cxx:352
uno::Reference< container::XNameContainer > m_xFrameStyles
Definition: txtimp.cxx:476
void MapCrossRefHeadingFieldsHorribly()
Definition: txtimp.cxx:2821
rtl::Reference< SvXMLImportPropertyMapper > const & GetRubyImportPropertySetMapper() const
Definition: txtimp.cxx:644
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph)
Definition: txtimp.cxx:2755
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: txtstyli.cxx:366
SvXMLTokenMap const & GetTextFrameAttrTokenMap()
Definition: txtimp.cxx:699
#define SAL_INFO_IF(condition, area, stream)
Reference< XFrame > xFrame
sal_Unicode ConvStarMathCharToStarSymbol(sal_Unicode c)
Definition: xmlimp.cxx:1769
void DeleteParagraph()
Definition: txtimp.cxx:1160
#define CONV_FROM_STAR_MATH
Definition: txtparai.hxx:34
const SvxXMLListStyleContext * FindAutoListStyle(const OUString &rName) const
Definition: txtimp.cxx:2378
std::unique_ptr< SvXMLTokenMap > m_xTextElemTokenMap
Definition: txtimp.cxx:419
const ::std::vector< XMLPropertyState > & GetProperties_()
Definition: txtstyli.hxx:90
void PopListContext()
pop the list context stack
Definition: txtimp.cxx:2456
constexpr sal_uInt16 XML_NAMESPACE_XLINK
std::unique_ptr< XMLTextListsHelper > m_xTextListsHelper
Definition: txtimp.cxx:430
sal_Int32 mnIndex
Definition: maptype.hxx:124
void SetOpenRedlineId(OUString const &rId)
modify the last open redline ID
Definition: txtimp.cxx:2788
std::map< OUString, BookmarkMapEntry_t > m_BookmarkStartRanges
start ranges for open bookmarks
Definition: txtimp.cxx:457
Definition: txtimp.hxx:330
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
SvI18NMap & GetRenameMap()
Definition: txtimp.cxx:2492
const OUString & GetDropCapStyleName() const
Definition: txtstyli.hxx:76
const css::uno::Reference< css::container::XNameContainer > & GetParaStyles() const
Definition: txtimp.cxx:584
rtl::Reference< SvXMLImportPropertyMapper > m_xFrameImpPrMap
Definition: txtimp.cxx:436
uno::Reference< container::XNameAccess > m_xTextFrames
Definition: txtimp.cxx:480
bool IsProgress() const
Definition: txtimp.cxx:578
std::unique_ptr< SvXMLTokenMap > m_xTextPElemTokenMap
Definition: txtimp.cxx:420
std::unique_ptr< std::vector< OUString >[]> m_xOutlineStylesCandidates
Definition: txtimp.cxx:449
#define CONV_FROM_STAR_BATS
Definition: txtparai.hxx:33
#define CTF_FONTFAMILYNAME
Definition: txtprmap.hxx:58
void ResetOpenRedlineId()
reset the last open redline ID
Definition: txtimp.cxx:2793
#define ODF_FORMDROPDOWN_RESULT
Definition: odffields.hxx:33
virtual bool IsInHeaderFooter() const
Definition: txtimp.cxx:2675
#define ODF_FORMCHECKBOX_RESULT
Definition: odffields.hxx:29
std::unique_ptr< SvXMLTokenMap > m_xTextPAttrTokenMap
Definition: txtimp.cxx:421
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rProtectionKey)
Definition: txtimp.cxx:2777
#define XML_TOKEN_MAP_END
Definition: xmltkmap.hxx:33
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOOoLink(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTblName, sal_Int32 nWidth, sal_Int32 nHeight)
Definition: txtimp.cxx:2691
XmlStyleFamily
Definition: families.hxx:47
sal_uInt16 sal_Unicode
SvXMLTokenMap const & GetTextElemTokenMap()
Definition: txtimp.cxx:669
std::unique_ptr< SvXMLTokenMap > m_xTextNumberedParagraphAttrTokenMap
Definition: txtimp.cxx:422
const SvXMLTokenMap & GetTextNumberedParagraphAttrTokenMap()
Definition: txtimp.cxx:2462
PropertiesInfo aProperties
OUString ConvertStarFonts(const OUString &rChars, const OUString &rStyleName, sal_uInt8 &rFlags, bool bPara, SvXMLImport &rImport) const
Definition: txtimp.cxx:1195
variable declaration container for all variable fields (variable-decls, user-field-decls, sequence-decls)
Definition: txtvfldi.hxx:378
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const SvXMLTokenMapEntry aTextNumberedParagraphAttrTokenMap[]
Definition: txtimp.cxx:325
void InsertString(const OUString &rChars)
Definition: txtimp.cxx:1092
const SvXMLTokenMapEntry aTextHyperlinkAttrTokenMap[]
Definition: txtimp.cxx:401
length
OUString msLastImportedFrameName
Definition: txtimp.cxx:465
int nCount
SvXMLTokenMap const & GetTextHyperlinkAttrTokenMap()
Definition: txtimp.cxx:719
virtual void RedlineAdd(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
Definition: txtimp.cxx:2736
const css::uno::Reference< css::container::XNameContainer > & GetFrameStyles() const
Definition: txtimp.cxx:602
void ListContextTop(XMLTextListBlockContext *&o_pListBlockContext, XMLTextListItemContext *&o_pListItemContext, XMLNumberedParaContext *&o_pNumberedParagraphContext)
peek at the top of the list context stack
Definition: txtlists.cxx:74
uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory
Definition: txtimp.cxx:483
std::unique_ptr< std::vector< OUString > > m_xNextFrmNames
Definition: txtimp.cxx:429
const OUString & getBookmarkCondition(OUString const &bookmark) const
Definition: txtimp.cxx:2876
const SvXMLTokenMapEntry aTextPElemTokenMap[]
Definition: txtimp.cxx:125
constexpr sal_uInt16 XML_NAMESPACE_DRAW
void addFieldParam(const OUString &name, const OUString &value)
Definition: txtimp.cxx:2561
uno::Reference< container::XNameContainer > m_xCellStyles
Definition: txtimp.cxx:478
const SvXMLTokenMapEntry aTextPAttrTokenMap[]
Definition: txtimp.cxx:306
uno::Reference< container::XNameContainer > m_xNumStyles
Definition: txtimp.cxx:475
void SetHyperlink(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rHRef, const OUString &rName, const OUString &rTargetFrameName, const OUString &rStyleName, const OUString &rVisitedStyleName, XMLEventsImportContext *pEvents)
Definition: txtimp.cxx:2004
static SvXMLImportPropertyMapper * CreateTableDefaultExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:971
void ConnectFrameChains(const OUString &rFrmName, const OUString &rNextFrmName, const css::uno::Reference< css::beans::XPropertySet > &rFrmPropSet)
Definition: txtimp.cxx:2600
OUString m_sOpenRedlineIdentifier
name of the last 'open' redline that started between paragraphs
Definition: txtimp.cxx:462
css::uno::Reference< css::text::XText > & GetText()
Definition: txtimp.cxx:543
const SvXMLTokenMap & GetTextListBlockElemTokenMap()
Definition: txtimp.cxx:2482
#define MAX_COMBINED_CHARACTERS
Definition: txtimp.cxx:415
::std::tuple< field_name_type_t, field_params_t, uno::Reference< text::XFormField > > field_stack_item_t
Definition: txtimp.cxx:500
static SvXMLImportContext * createOfficeFormsContext(SvXMLImport &_rImport)
creates an import context for the office:forms element
constexpr sal_uInt16 XML_NAMESPACE_XML
void Increment(sal_Int32 nInc=1)
css::uno::Reference< css::text::XTextRange > & GetCursorAsRange()
Definition: txtimp.cxx:553
constexpr sal_uInt16 XML_NAMESPACE_SVG
uno::Reference< container::XIndexReplace > m_xChapterNumbering
Definition: txtimp.cxx:479
std::unique_ptr< SvXMLTokenMap > m_xTextFrameAttrTokenMap
Definition: txtimp.cxx:425
uno::Reference< text::XTextCursor > m_xCursor
Definition: txtimp.cxx:471
OUString getCurrentFieldType()
Definition: txtimp.cxx:2570
bool IsInFrame() const
Definition: txtimp.cxx:2649
constexpr sal_uInt16 XML_NAMESPACE_FO
int i
SvXMLImport & GetXMLImport()
Definition: txtimp.cxx:659
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:223
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)
Definition: txtimp.cxx:2702
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
Definition: xmlimp.cxx:1888
const css::uno::Reference< css::container::XNameContainer > & GetPageStyles() const
Definition: txtimp.cxx:608
sal_Unicode ConvStarBatsCharToStarSymbol(sal_Unicode c)
Definition: xmlimp.cxx:1752
constexpr sal_uInt16 XML_NAMESPACE_TEXT
bool FindAndRemoveBookmarkStartRange(const OUString &sName, css::uno::Reference< css::text::XTextRange > &o_rRange, OUString &o_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &o_rpRDFaAttributes)
process the start of a range reference
Definition: txtimp.cxx:2512
void SetCellParaStyleDefault(OUString const &rNewValue)
Definition: txtimp.cxx:2799
SvXMLImportContext * CreateTextChildContext(SvXMLImport &rImport, sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, XMLTextType eType=XMLTextType::Shape)
Definition: txtimp.cxx:2135
::std::vector< field_param_t > field_params_t
Definition: txtimp.cxx:499
OUString SetStyleAndAttrs(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rStyleName, bool bPara, bool bOutlineLevelAttrFound=false, sal_Int8 nOutlineLevel=-1, bool bSetListAttrs=true, bool bOutlineContentVisible=true)
Definition: txtimp.cxx:1397
bool IsTextDocInOOoFileFormat() const
Definition: xmlimp.cxx:1878
const OUString & GetMasterPageName() const
Definition: txtstyli.hxx:74
float u
uno::Reference< text::XTextRange > m_xCursorAsRange
Definition: txtimp.cxx:472
bool getBookmarkHidden(OUString const &bookmark) const
Definition: txtimp.cxx:2871
ProgressBarHelper * GetProgressBarHelper()
Definition: xmlimp.cxx:1494
static SvXMLImportPropertyMapper * CreateParaDefaultExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:957
const css::uno::Reference< css::container::XIndexReplace > & GetChapterNumbering() const
Definition: txtimp.cxx:620
sal_uInt16 Get(sal_uInt16 nPrefix, const OUString &rLName) const
Definition: xmltkmap.cxx:99
size
std::vector< OUString > m_BookmarkVector
Definition: txtimp.cxx:459
constexpr sal_uInt16 XML_NAMESPACE_XHTML
void PushListContext()
push a list context on the list context stack
Definition: txtimp.cxx:2451
std::unique_ptr< SvXMLTokenMap > m_xTextListBlockElemTokenMap
Definition: txtimp.cxx:424
static bool lcl_HasListStyle(const OUString &sStyleName, const Reference< XNameContainer > &xParaStyles, SvXMLImport const &rImport, const OUString &sNumberingStyleName, std::u16string_view sOutlineStyleName)
Definition: txtimp.cxx:1279
bool IsInsertMode() const
Definition: txtimp.cxx:558
void FindOutlineStyleName(OUString &rStyleName, sal_Int8 nOutlineLevel)
Find a suitable name for the given outline level.
Definition: txtimp.cxx:1847
std::unique_ptr< SvI18NMap > m_xRenameMap
Definition: txtimp.cxx:440
bool hasCurrentFieldCtx() const
Definition: txtimp.cxx:2583
uno::Reference< container::XNameContainer > m_xTextStyles
Definition: txtimp.cxx:474
void InsertControlCharacter(sal_Int16 nControl)
Definition: txtimp.cxx:1137
void SetAutoStyles(SvXMLStylesContext *pStyles)
Definition: txtimp.cxx:2130
virtual ~XMLTextImportHelper() override
Definition: txtimp.cxx:933
::std::pair< OUString, OUString > field_param_t
Definition: txtimp.cxx:498
XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[]
bool HasMasterPageName() const
Definition: txtstyli.hxx:75
void PushListContext(XMLTextListBlockContext *i_pListBlock)
list stack for importing:
Definition: txtlists.cxx:51
const css::uno::Reference< css::container::XIndexReplace > & GetNumRules() const
Definition: txtparai.hxx:106
Impl(uno::Reference< frame::XModel > const &rModel, SvXMLImport &rImport, bool const bInsertMode, bool const bStylesOnlyMode, bool const bProgress, bool const bBlockMode, bool const bOrganizerMode)
Definition: txtimp.cxx:509
SvXMLTokenMap const & GetTextContourAttrTokenMap()
Definition: txtimp.cxx:709
OUString m_sCellParaStyleDefault
Definition: txtimp.cxx:505
const SvXMLTokenMapEntry aTextContourAttrTokenMap[]
Definition: txtimp.cxx:390
const SvXMLTokenMapEntry aTextFrameAttrTokenMap[]
Definition: txtimp.cxx:359
XMLTextListsHelper & GetTextListHelper()
Definition: txtimp.cxx:664
rtl::Reference< SvXMLImportPropertyMapper > m_xTextImpPrMap
Definition: txtimp.cxx:435
const css::uno::Reference< css::container::XNameContainer > & GetNumberingStyles() const
Definition: txtimp.cxx:596
rtl::Reference< SvXMLImportPropertyMapper > m_xRubyImpPrMap
Definition: txtimp.cxx:438
static SvXMLImportPropertyMapper * CreateTableCellExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:989
void SetRuby(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rStyleName, const OUString &rTextStyleName, const OUString &rText)
Definition: txtimp.cxx:2085
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
bool IsListStyleSet() const
Definition: txtstyli.hxx:69
void InsertTextContent(css::uno::Reference< css::text::XTextContent > const &xContent)
Definition: txtimp.cxx:1148
void InsertBookmarkStartRange(const OUString &sName, const css::uno::Reference< css::text::XTextRange > &rRange, OUString const &i_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &i_rpRDFaAttributes)
save the start of a range reference
Definition: txtimp.cxx:2501
virtual void RedlineAdjustStartNodeCursor()
Definition: txtimp.cxx:2763
std::unique_ptr< std::map< OUString, OUString > > m_pCrossRefHeadingBookmarkMap
Definition: txtimp.cxx:507
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
DefTokenId nToken
void StoreLastImportedFrameName(const OUString &rName)
Definition: txtimp.cxx:1082
::std::pair< OUString, OUString > field_name_type_t
Definition: txtimp.cxx:497
const css::uno::Reference< css::container::XNameContainer > & GetTextStyles() const
Definition: txtimp.cxx:590
void SetOutlineStyles(bool bSetEmpty)
Definition: txtimp.cxx:1908
css::uno::Reference< css::text::XFormField > popFieldCtx()
Definition: txtimp.cxx:2546
css::uno::Any maValue
Definition: maptype.hxx:125
constexpr sal_uInt16 XML_NAMESPACE_TABLE
const OUString & GetParentName() const
Definition: xmlstyle.hxx:82
uno::Reference< container::XNameContainer > m_xParaStyles
Definition: txtimp.cxx:473
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOLEObject(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTblName, sal_Int32 nWidth, sal_Int32 nHeight)
Definition: txtimp.cxx:2680
uno::Reference< container::XNameContainer > m_xPageStyles
Definition: txtimp.cxx:477
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1468
#define SAL_WARN_IF(condition, area, stream)
sal_Int16 GetStartValue() const
unsigned char sal_uInt8
uno::Reference< container::XNameAccess > m_xGraphics
Definition: txtimp.cxx:481
std::unique_ptr< SvXMLTokenMap > m_xTextHyperlinkAttrTokenMap
Definition: txtimp.cxx:427
void SetListItem(XMLTextListItemContext *pListItem)
set list item on top of the list context stack
Definition: txtlists.cxx:89
bool IsStylesOnlyMode() const
Definition: txtimp.cxx:563
std::unique_ptr< SvXMLTokenMap > m_xTextContourAttrTokenMap
Definition: txtimp.cxx:426
#define CONV_STAR_FONT_FLAGS_VALID
Definition: txtparai.hxx:35
Handling of tokens in XML:
XMLTextImportHelper(const XMLTextImportHelper &)=delete
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
Definition: txtimp.cxx:2392
#define SAL_INFO(area, stream)
#define ODF_FORMDROPDOWN_LISTENTRY
Definition: odffields.hxx:32
void PopListContext()
pop the list context stack
Definition: txtlists.cxx:67
const OUString & GetListId() const
Definition: txtparai.hxx:108
void AddOutlineStyleCandidate(const sal_Int8 nOutlineLevel, const OUString &rStyleName)
Definition: txtimp.cxx:1894
void ClearLastImportedTextFrameName()
Definition: txtimp.cxx:1087
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
Definition: txtimp.cxx:2333
void pushFieldCtx(const OUString &name, const OUString &type)
Definition: txtimp.cxx:2539
Definition: txtimp.hxx:331
rtl::Reference< SvXMLImportPropertyMapper > const & GetParaImportPropertySetMapper() const
Definition: txtimp.cxx:626
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
void copy(const fs::path &src, const fs::path &dest)
sal_Int16 GetStartValue() const
Definition: txtparai.hxx:109
QPRO_FUNC_TYPE nType
const char * name
rtl::Reference< SvXMLStylesContext > m_xAutoStyles
Definition: txtimp.cxx:432
SvXMLImport & m_rSvXMLImport
Definition: txtimp.cxx:485
void SetCursor(const css::uno::Reference< css::text::XTextCursor > &rCursor)
Definition: txtimp.cxx:1006
bool HasFrameByName(const OUString &rName) const
Definition: txtimp.cxx:1021
static SvXMLImportPropertyMapper * CreateDrawingPageExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:998
std::map< OUString, OUString > m_sBookmarkCondition
Definition: txtimp.cxx:468
bool IsDuplicateFrame(const OUString &sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) const
Definition: txtimp.cxx:1031
const SvXMLTokenMapEntry aTextElemTokenMap[]
Definition: txtimp.cxx:89
XMLTextType
Definition: txtimp.hxx:328
rtl::Reference< SvXMLImportPropertyMapper > const & GetSectionImportPropertySetMapper() const
Definition: txtimp.cxx:638
rtl::Reference< SvXMLImportPropertyMapper > const & GetTextImportPropertySetMapper() const
Definition: txtimp.cxx:632
const SvXMLTokenMap & GetTextListBlockAttrTokenMap()
Definition: txtimp.cxx:2472
const SvXMLTokenMapEntry aTextListBlockAttrTokenMap[]
Definition: txtimp.cxx:340
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void InitOutlineStylesCandidates()
Definition: txtimp.cxx:530
sal_Int16 GetLevel() const
Definition: txtparai.hxx:105
uno::Reference< container::XNameAccess > m_xObjects
Definition: txtimp.cxx:482
bool HasCombinedCharactersLetter() const
Definition: txtstyli.hxx:87
::std::stack< field_stack_item_t > field_stack_t
Definition: txtimp.cxx:501
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertFloatingFrame(const OUString &rName, const OUString &rHRef, const OUString &rStyleName, sal_Int32 nWidth, sal_Int32 nHeight)
Definition: txtimp.cxx:2720
import dde field declaration container ()
Definition: txtfldi.hxx:885
bool IsInsideDeleteContext() const
redlining : Getter to know if we are inside a element (deleted redline section) ...
Definition: txtimp.cxx:654
XMLPropStyleContext * FindPageMaster(const OUString &rName) const
Definition: txtimp.cxx:2422
static SvXMLImportPropertyMapper * CreateParaExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:950
void setBookmarkAttributes(OUString const &bookmark, bool hidden, OUString const &condition)
Definition: txtimp.cxx:2865
SvXMLTokenMap const & GetTextPAttrTokenMap()
Definition: txtimp.cxx:689
virtual void SetRecordChanges(bool bRecordChanges)
Definition: txtimp.cxx:2773
static SvXMLImportPropertyMapper * CreateTableRowDefaultExtPropMapper(SvXMLImport &)
Definition: txtimp.cxx:980
void ChainImportMapper(const rtl::Reference< SvXMLImportPropertyMapper > &rMapper)
Definition: xmlimppr.cxx:76
import change tracking/redlining markers , , ...
std::unique_ptr< std::vector< OUString > > m_xPrevFrmNames
Definition: txtimp.cxx:428
const OUString & GetListStyle() const
Definition: txtstyli.hxx:67
const css::uno::Reference< css::container::XNameContainer > & GetCellStyles() const
Definition: txtimp.cxx:614
bool IsSystemLanguage() const
determine whether number format uses the system language
Definition: xmlnumfi.cxx:2066
Impl & operator=(const Impl &)=delete
std::unique_ptr< SvXMLTokenMap > m_xTextListBlockAttrTokenMap
Definition: txtimp.cxx:423
constexpr sal_uInt16 XML_NAMESPACE_STYLE
rtl::Reference< SvXMLImportPropertyMapper > m_xSectionImpPrMap
Definition: txtimp.cxx:437
std::map< OUString, bool > m_bBookmarkHidden
Definition: txtimp.cxx:467
void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField > const &xFormField)
Definition: txtimp.cxx:2588
virtual void endAppletOrPlugin(const css::uno::Reference< css::beans::XPropertySet > &rPropSet,::std::map< const OUString, OUString > &rParamMap)
Definition: txtimp.cxx:2730
std::tuple< uno::Reference< text::XTextRange >, OUString, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > > BookmarkMapEntry_t
Definition: txtimp.cxx:455
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
Definition: xmlimp.hxx:605
OUString const & GetCellParaStyleDefault() const
Definition: txtimp.cxx:2804
constexpr sal_uInt16 XML_NAMESPACE_FIELD
field_stack_t m_FieldStack
Definition: txtimp.cxx:503
OUString sDisplayName
OUString const & GetOpenRedlineId() const
get the last open redline ID
Definition: txtimp.cxx:2783
sal_Int32 GetDataStyleKey(const OUString &sStyleName, bool *pIsSystemLanguage=nullptr)
return key appropriate for use with NumberFormat property return -1 if style is not found (may return...
Definition: txtimp.cxx:2342
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)