diff options
-rw-r--r-- | sw/inc/tox.hxx | 1 | ||||
-rw-r--r-- | sw/inc/unomap.hxx | 1 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx | bin | 0 -> 18485 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/index/cntex.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 1 |
14 files changed, 40 insertions, 5 deletions
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 3f54ad9ebb89..c4252a1c84dc 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -399,6 +399,7 @@ namespace nsSwTOXElement const SwTOXElement TOX_FRAME = 64; const SwTOXElement TOX_SEQUENCE = 128; const SwTOXElement TOX_TABLEADER = 256; + const SwTOXElement TOX_TAB_IN_TOC = 512; } typedef sal_uInt16 SwTOIOptions; diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx index d3c983a56573..e9e63a78218d 100644 --- a/sw/inc/unomap.hxx +++ b/sw/inc/unomap.hxx @@ -179,6 +179,7 @@ #define WID_LEVEL_FORMAT 1021 #define WID_LEVEL_PARAGRAPH_STYLES 1022 #define WID_HIDE_TABLEADER_PAGENUMBERS 1023 +#define WID_TAB_IN_TOC 1024 #define WID_MAIN_ENTRY_CHARACTER_STYLE_NAME 1025 #define WID_CREATE_FROM_TABLES 1026 #define WID_CREATE_FROM_TEXT_FRAMES 1027 diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 674d984cf9b9..da63af3c1d96 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -122,6 +122,7 @@ #define UNO_NAME_CHAR_ESCAPEMENT_HEIGHT "CharEscapementHeight" #define UNO_NAME_CHAR_COLOR "CharColor" #define UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS "HideTabLeaderAndPageNumber" +#define UNO_NAME_TAB_IN_TOC "TabInTOC" #define UNO_NAME_CHAR_FLASH "CharFlash" #define UNO_NAME_CHAR_KERNING "CharKerning" diff --git a/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx b/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx Binary files differnew file mode 100644 index 000000000000..ac294fd0fe94 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index fb09a2097c1d..6dd2669cceef 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2359,6 +2359,17 @@ DECLARE_OOXMLEXPORT_TEST(testPreserveZfield,"preserve_Z_field_TOC.docx") CPPUNIT_ASSERT(contents.match(" TOC \\z \\f \\o \"1-3\" \\h")); } + DECLARE_OOXMLEXPORT_TEST(testPreserveWfieldTOC, "PreserveWfieldTOC.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)); + CPPUNIT_ASSERT(contents.match(" TOC \\z \\w \\f \\o \"1-3\" \\h")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index d9c1c17f097d..33942aab9d67 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -655,6 +655,9 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, case WID_CREATE_FROM_OUTLINE: lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OUTLINELEVEL); break; + case WID_TAB_IN_TOC: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TAB_IN_TOC); + break; // case WID_PARAGRAPH_STYLE_NAMES :OSL_FAIL("not implemented") // break; case WID_HIDE_TABLEADER_PAGENUMBERS: diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index d6c2f522ef3d..cb371d30cc6f 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1414,6 +1414,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_LEVEL), WID_LEVEL , cppu::UnoType<sal_Int16>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_CREATE_FROM_MARKS), WID_CREATE_FROM_MARKS , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS), WID_HIDE_TABLEADER_PAGENUMBERS , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, + { OUString(UNO_NAME_TAB_IN_TOC), WID_TAB_IN_TOC, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(UNO_NAME_CREATE_FROM_OUTLINE), WID_CREATE_FROM_OUTLINE , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_IS_PROTECTED), WID_PROTECTED , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, @@ -1451,6 +1452,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s _BASE_INDEX_PROPERTIES_ { OUString(UNO_NAME_CREATE_FROM_MARKS), WID_CREATE_FROM_MARKS , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS), WID_HIDE_TABLEADER_PAGENUMBERS , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, + { OUString(UNO_NAME_TAB_IN_TOC), WID_TAB_IN_TOC, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_IS_PROTECTED), WID_PROTECTED , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, { OUString(UNO_NAME_USE_LEVEL_FROM_SOURCE), WID_USE_LEVEL_FROM_SOURCE , cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0b04ccb30aba..a94cd68adfa3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -33,6 +33,7 @@ #include "redline.hxx" #include "unocoll.hxx" #include "unoframe.hxx" +#include "wrtww8.hxx" #include "wrtww8.hxx" @@ -756,6 +757,10 @@ void DocxAttributeOutput::EndRun() DoWriteAnnotationMarks( ); m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + if(GetExport().bTabInTOC && m_pHyperlinkAttrList) + { + RunText(OUString("\t")) ; + } m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND ); // merges with "postponed run start", see above // write the run start + the run content diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 816f36eb73a0..28d9d695cd1f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -536,6 +536,7 @@ public: sal_uInt8 bHasHdr : 1; sal_uInt8 bHasFtr : 1; sal_uInt8 bSubstituteBullets : 1; // true: SubstituteBullet() gets called + sal_uInt8 bTabInTOC : 1; //true for TOC field flag 'w' sal_uInt8 bHideTabLeaderAndPageNumbers : 1 ; // true: the 'z' field of TOC is set. bool mbExportModeRTF; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 853f886f3a64..b5ad57edfdd9 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2115,6 +2115,11 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) sStr +="\\z " ; GetExport( ).bHideTabLeaderAndPageNumbers = true ; } + if(nsSwTOXElement::TOX_TAB_IN_TOC & pTOX->GetCreateType()) + { + sStr +="\\w " ; + GetExport( ).bTabInTOC = true ; + } if( nsSwTOXElement::TOX_MARK & pTOX->GetCreateType() ) { sStr += "\\f "; diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 5d1fe725da8b..28ff7f92ff0e 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -243,6 +243,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_TEXT_FRAMES, 0!=(nContentOptions&nsSwTOXElement::TOX_FRAME )); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_LABELS, 0!=(nContentOptions&nsSwTOXElement::TOX_SEQUENCE )); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS, 0!=(nContentOptions&nsSwTOXElement::TOX_TABLEADER )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TAB_IN_TOC, 0!=(nContentOptions&nsSwTOXElement::TOX_TAB_IN_TOC )); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_CHAPTER, rDesc.IsFromChapter()); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_IS_PROTECTED, rDesc.IsReadonly()); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index a5047a969ed8..3b9b52618763 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2696,6 +2696,7 @@ void DomainMapper_Impl::handleToc bool bFromOutline = false; bool bFromEntries = false; bool bHideTabLeaderPageNumbers = false ; + bool bIsTabEntry = false ; sal_Int16 nMaxLevel = 10; OUString sTemplate; @@ -2780,11 +2781,11 @@ void DomainMapper_Impl::handleToc bFromOutline = true; //todo: what doesn 'the applied paragraph outline level' refer to? } -// \w Preserve tab characters within table entries -// if( lcl_FindInCommand( pContext->GetCommand(), 'w', sValue )) -// { - //todo: not supported -// } +// \w Preserve tab characters within table entries + if( lcl_FindInCommand( pContext->GetCommand(), 'w', sValue )) + { + bIsTabEntry = true ; + } // \x Preserve newline characters within table entries // if( lcl_FindInCommand( pContext->GetCommand(), 'x', sValue )) // { @@ -2816,6 +2817,7 @@ void DomainMapper_Impl::handleToc xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_OUTLINE ), uno::makeAny( bFromOutline )); xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_MARKS ), uno::makeAny( bFromEntries )); xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_HIDE_TAB_LEADER_AND_PAGE_NUMBERS ), uno::makeAny( bHideTabLeaderPageNumbers )); + xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TAB_IN_TOC ), uno::makeAny( bIsTabEntry )); if( !sTemplate.isEmpty() ) { //the string contains comma separated the names and related levels diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index dfe4369c18cf..669ae071e6bc 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -361,6 +361,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_CHAR_THEME_FILL : sName = "CharThemeFill"; break; case PROP_HORIZONTAL_MERGE: sName = "HorizontalMerge"; break; case PROP_HIDE_TAB_LEADER_AND_PAGE_NUMBERS : sName = "HideTabLeaderAndPageNumber" ; break ; + case PROP_TAB_IN_TOC : sName = "TabInTOC"; break ; } ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 4f73caac3272..b8e6ae5d5340 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -332,6 +332,7 @@ enum PropertyIds ,PROP_CHAR_THEME_FILL ,PROP_HORIZONTAL_MERGE ,PROP_HIDE_TAB_LEADER_AND_PAGE_NUMBERS + ,PROP_TAB_IN_TOC }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier |