summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-02-21 10:39:10 +0000
committerNoel Power <noel.power@suse.com>2013-02-21 13:02:58 +0000
commitdb28ed792e08d3eef3e901eaedb255bdc66d1db1 (patch)
tree4346a345b39cedb87ae8589eabc2828629caa768
parentc4a8e6b62e80d79d98743af022b3d5e5d1f22f51 (diff)
adapt writer to use centralised font dialog and fix some minor bugs
fixed incorrect return of EmbeddFonts property and also make sure that NotifyEmbeddedFontRead is called on reload Change-Id: I085f50ff88bbf73b5dcdb9630b6c5844430a47c2
-rw-r--r--sw/Library_swui.mk1
-rw-r--r--sw/UI_swriter.mk1
-rw-r--r--sw/inc/globals.hrc2
-rw-r--r--sw/source/ui/app/app.src5
-rw-r--r--sw/source/ui/app/docsh2.cxx2
-rw-r--r--sw/source/ui/dialog/documentfontsdialog.cxx54
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx4
-rw-r--r--sw/source/ui/inc/documentfontsdialog.hxx44
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx1
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx1
10 files changed, 3 insertions, 112 deletions
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 4731533d5294..771ddfac1f6e 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -78,7 +78,6 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
sw/source/ui/dialog/abstract \
sw/source/ui/dialog/addrdlg \
sw/source/ui/dialog/ascfldlg \
- sw/source/ui/dialog/documentfontsdialog \
sw/source/ui/dialog/docstdlg \
sw/source/ui/dialog/macassgn \
sw/source/ui/dialog/swdialmgr \
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index 86e75e29cc48..d410de64faeb 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -21,7 +21,6 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/columnpage \
sw/uiconfig/swriter/ui/columnwidth \
sw/uiconfig/swriter/ui/converttexttable \
- sw/uiconfig/swriter/ui/documentfontspage \
sw/uiconfig/swriter/ui/endnotepage \
sw/uiconfig/swriter/ui/editcategories \
sw/uiconfig/swriter/ui/exchangedatabases \
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index 8a2b81d23a92..0653aaf8bc3e 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -30,7 +30,6 @@
#define STR_LOAD_GLOBAL_DOC (RC_GLOBALS_BEGIN + 2)
#define STR_DOC_STAT (RC_GLOBALS_BEGIN + 10)
-#define STR_DOC_FONTS (RC_GLOBALS_BEGIN + 107)
#define STR_PAGE (RC_GLOBALS_BEGIN + 14)
#define STR_PRINTOPTUI (RC_GLOBALS_BEGIN + 15)
@@ -139,7 +138,6 @@
#define TP_COLUMN (RC_GLOBALS_BEGIN + 13)
#define TP_DOC_STAT (RC_GLOBALS_BEGIN + 15)
-#define TP_DOC_FONTS (RC_GLOBALS_BEGIN + 108)
#define TP_HEADER_PAGE (RC_GLOBALS_BEGIN + 16)
#define TP_FOOTER_PAGE (RC_GLOBALS_BEGIN + 17)
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 9e1eff67aa93..38f114febcf8 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -305,11 +305,6 @@ String STR_DOC_STAT
Text [ en-US ] = "Statistics" ;
};
-String STR_DOC_FONTS
-{
- Text [ en-US ] = "Fonts" ;
-};
-
// ----------------------------
// Statusbar-titles
// ----------------------------
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index b13e53d35116..b306ded45dda 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -141,7 +141,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- pDlg->AddTabPage(TP_DOC_FONTS, SW_RESSTR(STR_DOC_FONTS),pFact->GetTabPageCreatorFunc( TP_DOC_FONTS ),0);
+ pDlg->AddFontTabPage();
pDlg->AddTabPage(TP_DOC_STAT, SW_RESSTR(STR_DOC_STAT),pFact->GetTabPageCreatorFunc( TP_DOC_STAT ),0);
}
}
diff --git a/sw/source/ui/dialog/documentfontsdialog.cxx b/sw/source/ui/dialog/documentfontsdialog.cxx
deleted file mode 100644
index 0ac99d5b8e94..000000000000
--- a/sw/source/ui/dialog/documentfontsdialog.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "documentfontsdialog.hxx"
-
-#include <doc.hxx>
-#include <docsh.hxx>
-
-SfxTabPage* SwDocumentFontsPage::Create( Window* parent, const SfxItemSet& set )
-{
- return new SwDocumentFontsPage( parent, set );
-}
-
-SwDocumentFontsPage::SwDocumentFontsPage( Window* parent, const SfxItemSet& set )
- : SfxTabPage( parent, "DocumentFontsPage", "modules/swriter/ui/documentfontspage.ui", set )
-{
- get( embedFontsCheckbox, "embedFonts" );
-}
-
-void SwDocumentFontsPage::Reset( const SfxItemSet& )
-{
- // I take it the SfxItemSet should be "officially" used, but the dialog
- // is modal (and SwDocStatPage does it too), so it should be safe, and
- // also simpler, to short-circuit directly to the setting.
- SwDocShell* docShell = static_cast< SwDocShell* >( SfxObjectShell::Current());
- SwDoc* doc = docShell->GetDoc();
- embedFontsCheckbox->Check( doc->get( IDocumentSettingAccess::EMBED_FONTS ));
-}
-
-sal_Bool SwDocumentFontsPage::FillItemSet( SfxItemSet& )
-{
- SwDocShell* docShell = static_cast< SwDocShell* >( SfxObjectShell::Current());
- SwDoc* doc = docShell->GetDoc();
- doc->set( IDocumentSettingAccess::EMBED_FONTS, embedFontsCheckbox->IsChecked());
- return false;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 8dfeac0810cd..da55531de7c6 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -47,7 +47,6 @@
#include "dbinsdlg.hxx" //add for SwInsertDBColAutoPilot
#include "docfnote.hxx" //add for SwFootNoteOptionDlg
#include "docstdlg.hxx" //add for SwDocStatPage
-#include "documentfontsdialog.hxx"
#include "DropDownFieldDialog.hxx" //add for DropDownFieldDialog
#include "envlop.hxx" //add for SwEnvDlg
#include "label.hxx" //add for SwLabDlg
@@ -1457,9 +1456,6 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI
case TP_DOC_STAT :
pRet = SwDocStatPage::Create;
break;
- case TP_DOC_FONTS :
- pRet = SwDocumentFontsPage::Create;
- break;
case RID_SW_TP_MAILCONFIG:
pRet = SwMailConfigPage::Create;
break;
diff --git a/sw/source/ui/inc/documentfontsdialog.hxx b/sw/source/ui/inc/documentfontsdialog.hxx
deleted file mode 100644
index 931b811af167..000000000000
--- a/sw/source/ui/inc/documentfontsdialog.hxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef SW_DOCUMENTFONTSDIALOG_HXX
-#define SW_DOCUMENTFONTSDIALOG_HXX
-
-#include <sfx2/tabdlg.hxx>
-
-#include <vcl/fixed.hxx>
-#include <svtools/stdctrl.hxx>
-
-/**
- Tab page for document font settings in the document properties dialog.
-*/
-class SwDocumentFontsPage: public SfxTabPage
-{
-public:
- SwDocumentFontsPage( Window* parent, const SfxItemSet& set );
- static SfxTabPage* Create( Window* parent, const SfxItemSet& set );
-protected:
- virtual sal_Bool FillItemSet( SfxItemSet& set );
- virtual void Reset( const SfxItemSet& set );
-private:
- CheckBox* embedFontsCheckbox;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 828b6037e763..b42e90710022 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -1194,6 +1194,7 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::EMBED_FONTS );
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
+ break;
case HANDLE_EMBED_SYSTEM_FONTS:
{
sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::EMBED_SYSTEM_FONTS );
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index e822fc6a9895..86433b8480db 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -265,6 +265,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url )
case osl::File::E_None:
break; // ok
case osl::File::E_EXIST:
+ GetImport().NotifyEmbeddedFontRead();
return; // Assume it's already been added correctly.
default:
SAL_WARN( "xmloff", "Cannot open file for temporary font" );