Kaydet (Commit) 010560f5 authored tarafından Szabolcs Dezsi's avatar Szabolcs Dezsi Kaydeden (comit) Andras Timar

i#84393 Fix title field in header, footer

According to help Title should be the Title property of the document,
not the file name without extension. If that property is missing, we
fall back to file name without extension.
üst 2118ec36
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include <basegfx/tools/zoomtools.hxx> #include <basegfx/tools/zoomtools.hxx>
#include <svx/zoom_def.hxx> #include <svx/zoom_def.hxx>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include "sc.hrc" #include "sc.hrc"
#include "scabstdlg.hxx" #include "scabstdlg.hxx"
...@@ -844,7 +845,11 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData ) ...@@ -844,7 +845,11 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
pDoc->GetName(nTab, aTmp); pDoc->GetName(nTab, aTmp);
rData.aTabName = 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(); const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
rData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ); rData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
if ( rData.aLongDocName.Len() ) if ( rData.aLongDocName.Len() )
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#include <vcl/lineinfo.hxx> #include <vcl/lineinfo.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#define ZOOM_MIN 10 #define ZOOM_MIN 10
...@@ -1037,7 +1038,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) ...@@ -1037,7 +1038,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) ); 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(); const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
aFieldData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ); aFieldData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
if ( aFieldData.aLongDocName.Len() ) if ( aFieldData.aLongDocName.Len() )
......
...@@ -97,6 +97,8 @@ ...@@ -97,6 +97,8 @@
#include "markdata.hxx" #include "markdata.hxx"
#include "preview.hxx" #include "preview.hxx"
#include <com/sun/star/document/XDocumentProperties.hpp>
void ActivateOlk( ScViewData* pViewData ); void ActivateOlk( ScViewData* pViewData );
void DeActivateOlk( ScViewData* pViewData ); void DeActivateOlk( ScViewData* pViewData );
...@@ -1824,7 +1826,11 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData ) ...@@ -1824,7 +1826,11 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData )
pDoc->GetName(nTab, aTmp); pDoc->GetName(nTab, aTmp);
rData.aTabName = 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(); const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
rData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ); rData.aLongDocName = rURLObj.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
if ( rData.aLongDocName.Len() ) if ( rData.aLongDocName.Len() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment