[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - writerfilter/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Mon Jul 8 02:05:04 PDT 2013


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   29 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 5a36fd99620aa1568e1140b5a78dc357390fba14
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jul 3 17:43:33 2013 +0200

    n#825976: Added common flags support for SEQ field import
    
    (cherry picked from commit 031ced0d1ade5350ef0b17a245a2cb5c76e6173d)
    
    Conflicts:
    	writerfilter/source/dmapper/DomainMapper_Impl.cxx
    
    Change-Id: I9a4505cf060880811abfe355b2ebf810cde9a4d6
    Reviewed-on: https://gerrit.libreoffice.org/4723
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1d96899..b51ed29 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3187,6 +3187,30 @@ void DomainMapper_Impl::CloseFieldCommand()
                         // attach the master to the field
                         uno::Reference< text::XDependentTextField > xDependentField( xFieldInterface, uno::UNO_QUERY_THROW );
                         xDependentField->attachTextFieldMaster( xMaster );
+
+                        rtl::OUString sFormula = sSeqName + "+1";
+                        rtl::OUString sValue;
+                        if( lcl_FindInCommand( pContext->GetCommand(), 'c', sValue ))
+                        {
+                            sFormula = sSeqName;
+                        }
+                        else if( lcl_FindInCommand( pContext->GetCommand(), 'r', sValue ))
+                        {
+                            sFormula = sValue;
+                        }
+                        // TODO \s isn't handled, but the spec isn't easy to understand without
+                        // an example for this one.
+                        xFieldProperties->setPropertyValue(
+                                rPropNameSupplier.GetName(PROP_CONTENT),
+                                uno::makeAny(sFormula));
+
+                        // Take care of the numeric formatting definition, default is Arabic
+                        sal_Int16 nNumberingType = lcl_ParseNumberingType(pContext->GetCommand());
+                        if (nNumberingType == style::NumberingType::PAGE_DESCRIPTOR)
+                            nNumberingType == style::NumberingType::ARABIC;
+                        xFieldProperties->setPropertyValue(
+                                rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+                                uno::makeAny(nNumberingType));
                     }
                     break;
                     case FIELD_SET          : break;
@@ -3264,15 +3288,14 @@ void DomainMapper_Impl::CloseFieldCommand()
                             rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
                             uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
                     break;
-
                 }
             }
             //set the text field if there is any
             pContext->SetTextField( uno::Reference< text::XTextField >( xFieldInterface, uno::UNO_QUERY ) );
         }
-        catch( const uno::Exception& )
+        catch( const uno::Exception& e )
         {
-            OSL_FAIL( "Exception in CloseFieldCommand()" );
+            SAL_WARN( "writerfilter", "Exception in CloseFieldCommand(): " << e.Message );
         }
         pContext->SetCommandCompleted();
     }


More information about the Libreoffice-commits mailing list