[PATCH] get rid of two-argument compareToAscii

Christian Lohmaier (via Code Review) gerrit at gerrit.libreoffice.org
Fri Mar 22 06:04:31 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2907

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/07/2907/1

get rid of two-argument compareToAscii

As I don't see a point in comparing a mimetype with only a
substring, it probably could be a simple compareToAscii, but
play it save and use startsWith.

Change-Id: Ic33c8089283def615999ddf80cd12f6fe219ed17
---
M vcl/aqua/source/dtrans/DataFlavorMapping.cxx
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index a1a69ff..6cfc2c9 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -526,7 +526,7 @@
 
   for (size_t i = 0; i < SIZE_FLAVOR_MAP; i++)
     {
-      if (oOOFlavor.MimeType.compareToAscii(flavorMap[i].OOoFlavor, strlen(flavorMap[i].OOoFlavor)) == 0)
+      if (oOOFlavor.MimeType.startsWith(flavorMap[i].OOoFlavor))
         {
           sysFlavor = flavorMap[i].SystemFlavor;
         }

-- 
To view, visit https://gerrit.libreoffice.org/2907
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic33c8089283def615999ddf80cd12f6fe219ed17
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>



More information about the LibreOffice mailing list