Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



Hi all!

I made a patch for this (https://issues.apache.org/ooo/show_bug.cgi?id=84393). It was present in LO 
too.
I hope I did everything right. Just let me know if something is incorrect.

Szabolcs
                                          
From 448af7eaa397bfe2f940c49798667fce99127a16 Mon Sep 17 00:00:00 2001
From: Szabolcs Dezsi <dezsiszabi@hotmail.com>
Date: Thu, 15 Mar 2012 15:23:17 +0100
Subject: [PATCH] Fix title field in header, footer

---
 sc/source/ui/view/prevwsh.cxx  |    7 ++++++-
 sc/source/ui/view/printfun.cxx |    7 ++++++-
 sc/source/ui/view/tabvwsh4.cxx |    8 +++++++-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 9dbe51f..ad3aa70 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -77,6 +77,7 @@
 
 #include <basegfx/tools/zoomtools.hxx>
 #include <svx/zoom_def.hxx>
+#include <com/sun/star/document/XDocumentProperties.hpp>
 
 #include "sc.hrc"
 #include "scabstdlg.hxx"
@@ -841,7 +842,11 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
     pDoc->GetName(nTab, aTmp);
     rData.aTabName = aTmp;
 
-    rData.aTitle        = pDocShell->GetTitle();
+    if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
+        rData.aTitle = pDocShell->getDocProperties()->getTitle();
+    else
+        rData.aTitle = pDocShell->GetTitle();
+
     const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
     rData.aLongDocName  = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
     if ( rData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 01f1b5b..9d82ba5 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -83,6 +83,7 @@
 #include <vcl/lineinfo.hxx>
 
 #include <boost/scoped_ptr.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
 
 #define ZOOM_MIN    10
 
@@ -1037,7 +1038,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
 
     SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) );
 
-    aFieldData.aTitle       = pDocShell->GetTitle();
+    if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
+        aFieldData.aTitle = pDocShell->getDocProperties()->getTitle();
+    else
+        aFieldData.aTitle = pDocShell->GetTitle();
+
     const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
     aFieldData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
     if ( aFieldData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index cf93d15..35c2c54 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -97,6 +97,8 @@
 #include "markdata.hxx"
 #include "preview.hxx"
 
+#include <com/sun/star/document/XDocumentProperties.hpp>
+
 void ActivateOlk( ScViewData* pViewData );
 void DeActivateOlk( ScViewData* pViewData );
 
@@ -1824,7 +1826,11 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData )
     pDoc->GetName(nTab, aTmp);
     rData.aTabName = aTmp;
 
-    rData.aTitle        = pDocShell->GetTitle();
+    if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
+        rData.aTitle = pDocShell->getDocProperties()->getTitle();
+    else
+        rData.aTitle = pDocShell->GetTitle();
+
     const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
     rData.aLongDocName  = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
     if ( rData.aLongDocName.Len() )
-- 
1.7.7


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.