editeng/source/uno/unofield.cxx |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit f4a8954165eade1730a19a0e25fc08ae7f1825c8
Author:     Bogdan Buzea <buzea.bog...@libreoffice.org>
AuthorDate: Mon Oct 21 08:35:45 2024 +0200
Commit:     David Gilbert <freedesk...@treblig.org>
CommitDate: Sun Oct 27 01:26:21 2024 +0200

    tdf#163486: PVS: Identical branches
    
    V1037 Two or more case-branches perform the same actions. Check lines: 804, 
820, 832
    
    Change-Id: I25b810a91c6981f36fbad34c6ad64bc3656f6ddb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175278
    Reviewed-by: David Gilbert <freedesk...@treblig.org>
    Tested-by: Jenkins

diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index e474647450e9..cc2eb9b6367c 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -801,6 +801,8 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextField::getSupportedServiceNames()
     switch (mnServiceId)
     {
         case text::textfield::Type::DATE:
+        case text::textfield::Type::TIME:
+        case text::textfield::Type::EXTENDED_TIME:
             pServices[2] = "com.sun.star.text.TextField.DateTime";
             pServices[3] = "com.sun.star.text.textfield.DateTime";
         break;
@@ -816,10 +818,6 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextField::getSupportedServiceNames()
             pServices[2] = "com.sun.star.text.TextField.PageCount";
             pServices[3] = "com.sun.star.text.textfield.PageCount";
         break;
-        case text::textfield::Type::TIME:
-            pServices[2] = "com.sun.star.text.TextField.DateTime";
-            pServices[3] = "com.sun.star.text.textfield.DateTime";
-        break;
         case text::textfield::Type::DOCINFO_TITLE:
             pServices[2] = "com.sun.star.text.TextField.docinfo.Title";
             pServices[3] = "com.sun.star.text.textfield.docinfo.Title";
@@ -828,10 +826,6 @@ uno::Sequence< OUString > SAL_CALL 
SvxUnoTextField::getSupportedServiceNames()
             pServices[2] = "com.sun.star.text.TextField.SheetName";
             pServices[3] = "com.sun.star.text.textfield.SheetName";
         break;
-        case text::textfield::Type::EXTENDED_TIME:
-            pServices[2] = "com.sun.star.text.TextField.DateTime";
-            pServices[3] = "com.sun.star.text.textfield.DateTime";
-        break;
         case text::textfield::Type::EXTENDED_FILE:
             pServices[2] = "com.sun.star.text.TextField.FileName";
             pServices[3] = "com.sun.star.text.textfield.FileName";

Reply via email to