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