[Libreoffice-commits] core.git: 2 commits - writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Sat Feb 14 10:33:45 PST 2015


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    8 ++++----
 writerfilter/source/dmapper/SdtHelper.cxx         |   20 ++++++++++----------
 writerfilter/source/rtftok/rtfdocumentimpl.cxx    |   18 +++++++++---------
 writerfilter/source/rtftok/rtfdocumentimpl.hxx    |   12 ++++++------
 4 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit 07d92d7c67822a7645deadd38729d03e14d55158
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Feb 14 13:26:23 2015 +0100

    writerfilter: turn RTFFormFieldTypes into a C++11 scoped enumeration
    
    Change-Id: Ic99f1f30d799433e42ccc51a2e2019c60038222a

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index c3f5f76..0b124a5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -249,7 +249,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
       m_aAuthors(),
       m_aFormfieldSprms(),
       m_aFormfieldAttributes(),
-      m_nFormFieldType(FORMFIELD_NONE),
+      m_nFormFieldType(RTFFormFieldType::NONE),
       m_aObjectSprms(),
       m_aObjectAttributes(),
       m_bObject(false),
@@ -4354,29 +4354,29 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
         switch (nParam)
         {
         case 0:
-            m_nFormFieldType = FORMFIELD_TEXT;
+            m_nFormFieldType = RTFFormFieldType::TEXT;
             break;
         case 1:
-            m_nFormFieldType = FORMFIELD_CHECKBOX;
+            m_nFormFieldType = RTFFormFieldType::CHECKBOX;
             break;
         case 2:
-            m_nFormFieldType = FORMFIELD_LIST;
+            m_nFormFieldType = RTFFormFieldType::LIST;
             break;
         default:
-            m_nFormFieldType = FORMFIELD_NONE;
+            m_nFormFieldType = RTFFormFieldType::NONE;
             break;
         }
         break;
     case RTF_FFDEFRES:
-        if (m_nFormFieldType == FORMFIELD_CHECKBOX)
+        if (m_nFormFieldType == RTFFormFieldType::CHECKBOX)
             m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFCheckBox_default, pIntValue);
-        else if (m_nFormFieldType == FORMFIELD_LIST)
+        else if (m_nFormFieldType == RTFFormFieldType::LIST)
             m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFDDList_default, pIntValue);
         break;
     case RTF_FFRES:
-        if (m_nFormFieldType == FORMFIELD_CHECKBOX)
+        if (m_nFormFieldType == RTFFormFieldType::CHECKBOX)
             m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFCheckBox_checked, pIntValue);
-        else if (m_nFormFieldType == FORMFIELD_LIST)
+        else if (m_nFormFieldType == RTFFormFieldType::LIST)
             m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFDDList_result, pIntValue);
         break;
     case RTF_EDMINS:
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 09bd60d..b59ac377 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -61,12 +61,12 @@ enum RTFBufferTypes
 };
 
 /// Form field types
-enum RTFFormFieldTypes
+enum class RTFFormFieldType
 {
-    FORMFIELD_NONE,
-    FORMFIELD_TEXT,
-    FORMFIELD_CHECKBOX,
-    FORMFIELD_LIST
+    NONE,
+    TEXT,
+    CHECKBOX,
+    LIST
 };
 
 enum class RTFBmpStyle
@@ -537,7 +537,7 @@ private:
 
     RTFSprms m_aFormfieldSprms;
     RTFSprms m_aFormfieldAttributes;
-    RTFFormFieldTypes m_nFormFieldType;
+    RTFFormFieldType m_nFormFieldType;
 
     RTFSprms m_aObjectSprms;
     RTFSprms m_aObjectAttributes;
commit 64440bee7fdab52f2b913b5d37edd7bcc5b0e412
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Feb 14 12:37:57 2015 +0100

    indentation fixes
    
    Change-Id: I93bf9ab7ed32e60b735ad04b5da3de3c9aea6501

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 78d236b..31e828b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3191,10 +3191,10 @@ void DomainMapper_Impl::handleToc
                         //todo: what doesn 'the applied paragraph outline level' refer to?
     }
 //    \w Preserve tab characters within table entries
-     if( lcl_FindInCommand( pContext->GetCommand(), 'w', sValue ))
-     {
-         bIsTabEntry = true ;
-     }
+    if( lcl_FindInCommand( pContext->GetCommand(), 'w', sValue ))
+    {
+        bIsTabEntry = true ;
+    }
 //                  \x Preserve newline characters within table entries
     if( lcl_FindInCommand( pContext->GetCommand(), 'x', sValue ))
     {
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index bc91634..1c98e6f 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -93,18 +93,18 @@ void SdtHelper::createDropDownControl()
 void SdtHelper::createDateControl(OUString& rContentText, beans::PropertyValue aCharFormat)
 {
     uno::Reference<awt::XControlModel> xControlModel;
-    try {
-        xControlModel.set(
-            m_rDM_Impl.GetTextFactory()->createInstance(
-                "com.sun.star.form.component.DateField"),
-            uno::UNO_QUERY_THROW);
-    } catch (css::uno::RuntimeException &) {
+    try
+    {
+        xControlModel.set(m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.form.component.DateField"), uno::UNO_QUERY_THROW);
+    }
+    catch (css::uno::RuntimeException&)
+    {
         throw;
-    } catch (css::uno::Exception & e) {
+    }
+    catch (css::uno::Exception& e)
+    {
         css::uno::Any a(cppu::getCaughtException());
-        throw css::lang::WrappedTargetRuntimeException(
-            "wrapped " + a.getValueTypeName() + ": " + e.Message,
-            css::uno::Reference<css::uno::XInterface>(), a);
+        throw css::lang::WrappedTargetRuntimeException("wrapped " + a.getValueTypeName() + ": " + e.Message, css::uno::Reference<css::uno::XInterface>(), a);
     }
     uno::Reference<beans::XPropertySet> xPropertySet(
         xControlModel, uno::UNO_QUERY_THROW);


More information about the Libreoffice-commits mailing list