summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/document.hxx11
-rw-r--r--sc/source/core/data/documen2.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx46
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx38
-rw-r--r--sc/source/ui/docshell/docsh.cxx1
-rw-r--r--sc/source/ui/inc/docsh.hxx5
6 files changed, 47 insertions, 57 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 95443b5d9745..0b7fe1d1ae18 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -443,18 +443,7 @@ private:
bool mbUseEmbedFonts;
- OUString msDocAccTitle;
-
-public:
- void setDocAccTitle( const OUString& rTitle ) { msDocAccTitle = rTitle; }
- const OUString getDocAccTitle() const { return msDocAccTitle; }
-
-private:
- bool mbReadOnly;
-
public:
- void setDocReadOnly(bool b){ mbReadOnly = b; }
- bool getDocReadOnly() const { return mbReadOnly; }
sal_Bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder);
void GetCellChangeTrackNote(const ScAddress &cell, OUString &strTrackText, sal_Bool &pbLeftEdge);
bool IsUsingEmbededFonts() { return mbUseEmbedFonts; }
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 583109677d90..8803d256ab07 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -220,8 +220,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
mbStreamValidLocked( false ),
mbUserInteractionEnabled(true),
mnNamedRangesLockCount(0),
- mbUseEmbedFonts(false),
- mbReadOnly(false)
+ mbUseEmbedFonts(false)
{
SetStorageGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT);
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 47a5177c9b39..993da134ce57 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -69,6 +69,7 @@
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <sfx2/viewfrm.hxx>
+#include <sfx2/docfile.hxx>
#include <svx/unoshcol.hxx>
#include <svx/unoshape.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
@@ -1859,30 +1860,33 @@ OUString SAL_CALL
ScAccessibleDocument::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
- OUString sName = ScResId(STR_ACC_DOC_SPREADSHEET);
+ OUString aName = ScResId(STR_ACC_DOC_SPREADSHEET);
ScDocument* pScDoc = GetDocument();
- if ( pScDoc )
+ if (!pScDoc)
+ return aName;
+
+ SfxObjectShell* pObjSh = pScDoc->GetDocumentShell();
+ if (!pObjSh)
+ return aName;
+
+ OUString aFileName;
+ SfxMedium* pMed = pObjSh->GetMedium();
+ if (pMed)
+ aFileName = pMed->GetName();
+
+ if (aFileName.isEmpty())
+ aFileName = pObjSh->GetTitle(SFX_TITLE_APINAME);
+
+
+ if (!aFileName.isEmpty())
{
- OUString sFileName = pScDoc->getDocAccTitle();
- if ( !sFileName.getLength() )
- {
- SfxObjectShell* pObjSh = pScDoc->GetDocumentShell();
- if ( pObjSh )
- {
- sFileName = pObjSh->GetTitle( SFX_TITLE_APINAME );
- }
- }
- OUString sReadOnly;
- if (pScDoc->getDocReadOnly())
- {
- sReadOnly = ScResId(STR_ACC_DOC_SPREADSHEET_READONLY);
- }
- if ( sFileName.getLength() )
- {
- sName = sFileName + sReadOnly + " - " + sName;
- }
+ OUString aReadOnly;
+ if (pObjSh->IsReadOnly())
+ aReadOnly = ScResId(STR_ACC_DOC_SPREADSHEET_READONLY);
+
+ aName = aFileName + aReadOnly + " - " + aName;
}
- return sName;
+ return aName;
}
///===== XAccessibleSelection ===========================================
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 94c28ecc4d53..d9abbb9c0fd8 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -51,6 +51,7 @@
#include <svx/unoshape.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <vcl/svapp.hxx>
+#include <sfx2/docfile.hxx>
#include <comphelper/servicehelper.hxx>
#include <vector>
@@ -1699,28 +1700,31 @@ ScShapeChildren* ScAccessibleDocumentPagePreview::GetShapeChildren()
OUString ScAccessibleDocumentPagePreview::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
- OUString sName = ScResId(STR_ACC_DOC_SPREADSHEET);
+ OUString aName = ScResId(STR_ACC_DOC_SPREADSHEET);
ScDocument* pScDoc = mpViewShell->GetDocument();
- if ( pScDoc )
+ if (!pScDoc)
+ return aName;
+
+ SfxObjectShell* pObjSh = pScDoc->GetDocumentShell();
+ if (!pObjSh)
+ return aName;
+
+ OUString aFileName;
+ SfxMedium* pMed = pObjSh->GetMedium();
+ if (pMed)
+ aFileName = pMed->GetName();
+
+ if (aFileName.isEmpty())
+ aFileName = pObjSh->GetTitle(SFX_TITLE_APINAME);
+
+ if (!aFileName.isEmpty())
{
- OUString sFileName = pScDoc->getDocAccTitle();
- if ( !sFileName.getLength() )
- {
- SfxObjectShell* pObjSh = pScDoc->GetDocumentShell();
- if ( pObjSh )
- {
- sFileName = pObjSh->GetTitle( SFX_TITLE_APINAME );
- }
- }
- if ( sFileName.getLength() )
- {
- sName = sFileName + " - " + sName;
- sName += ScResId(STR_ACC_DOC_PREVIEW_SUFFIX);
+ aName = aFileName + " - " + aName;
+ aName += ScResId(STR_ACC_DOC_PREVIEW_SUFFIX);
- }
}
- return sName;
+ return aName;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 3e182701fce8..01d473605480 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1606,7 +1606,6 @@ sal_Bool ScDocShell::Save()
PrepareSaveGuard aPrepareGuard( *this);
- aDocument.setDocAccTitle(OUString());
SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
if (pFrame1)
{
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 9bff2f06ad78..7e103902fb1f 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -423,11 +423,6 @@ public:
void SetSolverSaveData( const ScOptSolverSave& rData );
ScSheetSaveData* GetSheetSaveData();
- void setDocAccTitle( const OUString& rTitle ) { aDocument.setDocAccTitle( rTitle ); }
- const OUString getDocAccTitle() const { return aDocument.getDocAccTitle(); }
- void setDocReadOnly(bool b) { aDocument.setDocReadOnly(b); }
- bool getDocReadOnly() const { return aDocument.getDocReadOnly(); }
-
void ResetKeyBindings( ScOptionsUtil::KeyBindingType eType );
// password protection for Calc (derived from SfxObjectShell)