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