Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


This replaces the earlier version of this patch, which was wrong for the
NUMBER_FULL_CONTEXT cross-reference type.
---
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 9944c8c..b3e88ea 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2680,6 +2680,21 @@ void DomainMapper_Impl::CloseFieldCommand()
                             //above-below
                             nFieldPart = text::ReferenceFieldPart::UP_DOWN;
                         }
+                        else if( lcl_FindInCommand( pContext->GetCommand(), 'r', sValue ))
+                        {
+                            //number
+                            nFieldPart = text::ReferenceFieldPart::NUMBER;
+                        }
+                        else if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
+                        {
+                            //number-no-context
+                            nFieldPart = text::ReferenceFieldPart::NUMBER_NO_CONTEXT;
+                        }
+                        else if( lcl_FindInCommand( pContext->GetCommand(), 'w', sValue ))
+                        {
+                            //number-full-context
+                            nFieldPart = text::ReferenceFieldPart::NUMBER_FULL_CONTEXT;
+                        }
                         xFieldProperties->setPropertyValue(
                                 rPropNameSupplier.GetName( PROP_REFERENCE_FIELD_PART ), 
uno::makeAny( nFieldPart ));
                     }
@@ -2980,7 +2995,10 @@ void DomainMapper_Impl::AddBookmark( const ::rtl::OUString& rBookmarkName, 
const
             xCursor->gotoRange( xTextAppend->getEnd(), true );
             uno::Reference< container::XNamed > xBkmNamed( xBookmark, uno::UNO_QUERY_THROW );
             //todo: make sure the name is not used already!
-            xBkmNamed->setName( aBookmarkIter->second.m_sBookmarkName );
+            if ( aBookmarkIter->second.m_sBookmarkName.getLength() > 0 )
+                xBkmNamed->setName( aBookmarkIter->second.m_sBookmarkName );
+            else
+                xBkmNamed->setName( rBookmarkName );
             xTextAppend->insertTextContent( uno::Reference< text::XTextRange >( xCursor, 
uno::UNO_QUERY_THROW), xBookmark, !xCursor->isCollapsed() );
             m_aBookmarkMap.erase( aBookmarkIter );
         }
-- 
1.7.2.5


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.