[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 4 commits - filter/source include/vcl vcl/quartz vcl/source

Tor Lillqvist tml at collabora.com
Wed Dec 3 05:52:01 PST 2014


 filter/source/pdf/impdialog.cxx   |    7 +++++++
 filter/source/pdf/impdialog.hrc   |    4 ++++
 filter/source/pdf/impdialog.src   |   10 ++++++++++
 filter/source/pdf/pdfexport.cxx   |    2 +-
 include/vcl/pdfwriter.hxx         |    5 ++++-
 vcl/quartz/ctlayout.cxx           |   14 +++++++-------
 vcl/source/gdi/pdfwriter_impl.cxx |   16 ++++++++++++++--
 7 files changed, 47 insertions(+), 11 deletions(-)

New commits:
commit 24ffd0d942716b7652bb89d1a1a7d171b1bf7bfa
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Dec 3 14:02:34 2014 +0200

    fdo#83939: Set error code if signing failed
    
    Change-Id: I45f1077c744e20a369a73bf0b83c8dba04ddcda7

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 06a7fe0..1572b90 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6966,7 +6966,13 @@ bool PDFWriterImpl::emit()
 
 #if !defined(ANDROID) && !defined(IOS)
     if (m_nSignatureObject != -1) // if document is signed, emit sigdict
-        CHECK_RETURN( emitSignature() );
+    {
+        if( !emitSignature() )
+        {
+            m_aErrors.insert( PDFWriter::Error_Signature_Failed );
+            return false;
+        }
+    }
 #endif
 
     // emit trailer
@@ -6974,7 +6980,13 @@ bool PDFWriterImpl::emit()
 
 #if !defined(ANDROID) && !defined(IOS)
     if (m_nSignatureObject != -1) // finalize the signature
-        CHECK_RETURN( finalizeSignature() );
+    {
+        if( !finalizeSignature() )
+        {
+            m_aErrors.insert( PDFWriter::Error_Signature_Failed );
+            return false;
+        }
+    }
 #endif
 
     m_aFile.close();
commit 21f065e66743a0cbf0ac83cd368cd07636e638d4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Dec 3 14:01:58 2014 +0200

    fdo#83939: Add new error code for failed PDF signing, and handle it
    
    Change-Id: Ide6dc06d33faea795272d9d32fc028ac8d023c5a

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 20e0350..b024d17 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1496,6 +1496,13 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
             m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_WARN_TRANSP_CONVERTED ) ) );
         }
         break;
+        case vcl::PDFWriter::Error_Signature_Failed:
+        {
+            sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_ERR_SIGNATURE_FAILED ) ),
+                                                aErrImg );
+            m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_ERR_PDF_EXPORT_ABORTED ) ) );
+        }
+        break;
         default:
             break;
         }
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index d55d590..57f1045 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -19,6 +19,9 @@
 
 #include <filter.hrc>
 
+#define STR_ERR_SIGNATURE_FAILED        (RID_PDF_DIALOG_START + 0)
+#define STR_ERR_PDF_EXPORT_ABORTED      (RID_PDF_DIALOG_START + 1)
+
 #define STR_WARN_PASSWORD_PDFA          (RID_PDF_DIALOG_START + 6)
 
 //strings for PDF security, user password management
@@ -39,5 +42,6 @@
 #define IMG_ERR                         (RID_PDF_DIALOG_START + 18)
 
 //ATTENTION: maximum allowed value is   (RID_PDF_DIALOG_START + 19)
+//(see filter/inc/filter.hrc)
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index 8bb0512..53ba8f2 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -78,6 +78,16 @@ String STR_WARN_TRANSP_CONVERTED_SHORT
     Text [en-US] = "Transparencies removed";
 };
 
+String STR_ERR_SIGNATURE_FAILED
+{
+    Text [en-US] = "Signature generation failed";
+};
+
+String STR_ERR_PDF_EXPORT_ABORTED
+{
+    Text [en-US] = "PDF export aborted";
+};
+
 Bitmap IMG_WARN
 {
     File = "ballgreen_7.png";
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 880e2fa..5b4b35d 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -216,7 +216,10 @@ public:
 
         // transparent objects were converted to a bitmap in order
         // to removetransparencies from the output
-        Warning_Transparency_Converted
+        Warning_Transparency_Converted,
+
+        // signature generation failed
+        Error_Signature_Failed,
     };
 
     struct VCL_DLLPUBLIC AnyWidget
commit 002cb3c4f7917ef52c1364743e52807ffbdc2fc0
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Dec 3 14:00:38 2014 +0200

    fdo#83939: Check return value from pPDFWriter->Emit()
    
    Change-Id: Id492b1b6b9d534276c155b1e46953d098ce8b969

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index ffa9e42..9e83456 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -914,7 +914,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
                 if( bRet )
                 {
                     pPDFExtOutDevData->PlayGlobalActions( *pPDFWriter );
-                    pPDFWriter->Emit();
+                    bRet = pPDFWriter->Emit();
                     aErrors = pPDFWriter->GetErrors();
                 }
                 pOut->SetExtOutDevData( NULL );
commit 2f95a5f5b1564cc115f007403869741608ae2c01
Author: galbarnissan <gal.bar.nissan at cloudon.com>
Date:   Wed Dec 3 11:55:31 2014 +0200

    fdo#85806: Hebrew and Arabic is not working on MAC
    
    Change-Id: Id4476a041eb539d0b9c1227070289d34a939c6f6
    Reviewed-on: https://gerrit.libreoffice.org/13288
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 759b3f5..5803976 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -217,7 +217,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
 
     DeviceCoordinate nPixelWidth = 0;
 
-    if(rArgs.mpDXArray)
+    if(rArgs.mpDXArray && !(rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) )
     {
         nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
         if( nPixelWidth <= 0)
@@ -231,18 +231,18 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
             mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
             if( nPixelWidth <= 0)
                 return;
-            // in RTL-layouts trailing spaces are leftmost
-            // TODO: use BiDi-algorithm to thoroughly check this assumption
-            if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
-            {
-                mfBaseAdv = mfTrailingSpaceWidth;
-            }
         }
         mfCachedWidth = nPixelWidth;
     }
     else
     {
         nPixelWidth = rArgs.mnLayoutWidth;
+
+        if( nPixelWidth <= 0 && rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
+        {
+            nPixelWidth = GetTextWidth();
+        }
+
         if( nPixelWidth <= 0)
             return;
 


More information about the Libreoffice-commits mailing list