[Libreoffice-commits] core.git: sw/source

Douglas Mencken dougmencken at gmail.com
Wed Apr 6 15:53:55 UTC 2016


 sw/source/filter/ww8/wrtww8.cxx |   42 +++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 22 deletions(-)

New commits:
commit 871f49e7fadb863b55c96c3f58ea7cc8fb033b40
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Thu Mar 31 09:04:29 2016 -0400

    convert blob's hex bytes to ascii symbols
    
    plus drop some auxiliary variables & assignments
    
    Change-Id: I2e9243fb70b46ada46cee09197ba4cecbc62e7fd
    Reviewed-on: https://gerrit.libreoffice.org/23701
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 3fbc18b..06697ce 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3375,37 +3375,35 @@ void WW8Export::ExportDocument_Impl()
 
 void WW8Export::PrepareStorage()
 {
-    sal_uLong nLen;
-    const sal_uInt8* pData;
-    const char* pName;
-
-    static const char aUserName[] = "Microsoft Word-Document";
-    static const sal_uInt8 aCompObj[] =
+    static const char pName[] = "Microsoft Word-Document";
+    static const sal_uInt8 pData[] =
     {
         0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
         0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x09, 0x02, 0x00,
         0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x46, 0x18, 0x00, 0x00, 0x00,
-        0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-        0x74, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x2D, 0x44,
-        0x6F, 0x6B, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x00,
-        0x0A, 0x00, 0x00, 0x00, 0x4D, 0x53, 0x57, 0x6F,
-        0x72, 0x64, 0x44, 0x6F, 0x63, 0x00, 0x10, 0x00,
-        0x00, 0x00, 0x57, 0x6F, 0x72, 0x64, 0x2E, 0x44,
-        0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E,
-        0x38, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00
-    };
+        0x00, 0x00, 0x00, 0x46,
+
+        0x18, 0x00, 0x00, 0x00,
+        'M', 'i', 'c', 'r', 'o', 's', 'o', 'f',
+        't', ' ', 'W', 'o', 'r', 'd', '-', 'D',
+        'o', 'k', 'u', 'm', 'e', 'n', 't', 0x0,
 
-    pName = aUserName;
-    pData = aCompObj;
-    nLen = sizeof( aCompObj );
+        0x0A, 0x00, 0x00, 0x00,
+        'M', 'S', 'W', 'o', 'r', 'd', 'D', 'o',
+        'c', 0x0,
+
+        0x10, 0x00, 0x00, 0x00,
+        'W', 'o', 'r', 'd', '.', 'D', 'o', 'c',
+        'u', 'm', 'e', 'n', 't', '.', '8', 0x0,
+
+        0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    };
 
     SvGlobalName aGName(MSO_WW8_CLASSID);
     GetWriter().GetStorage().SetClass( aGName, SotClipboardFormatId::NONE, OUString::createFromAscii( pName ));
     tools::SvRef<SotStorageStream> xStor( GetWriter().GetStorage().OpenSotStream(sCompObj) );
-    xStor->Write( pData, nLen );
+    xStor->Write( pData, sizeof( pData ) );
 
     SwDocShell* pDocShell = m_pDoc->GetDocShell ();
     OSL_ENSURE(pDocShell, "no SwDocShell");


More information about the Libreoffice-commits mailing list