* docx-brightness-contrast-1.diff * docx-brightness-contrast-2.diff - bnc#875712 - LO-L3: DOC import: picture brigtness/contrast not imported * doc-brightness-contrast.diff - bnc#870240 - LO-L3: pptx import file has text rotated on slide * fix-text-rotation.diff - bnc#870234 - LO-L3: pptx file has text imported as black instead of white * import-gradfill-for-text-colors.diff - bnc#870228 - LO-L3: Text inside the circle is not centered * text-alignment-in-shape.diff - bnc#863021 - LO-L3: Allow setting language for slide or presentation entirely * set-language-in-impress.diff - fix build on openSUSE 12.3: * disable-firebird-unit-test.diff OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=154
246 lines
8.6 KiB
Diff
246 lines
8.6 KiB
Diff
From d5aedeef765d60c7420ada7eba8405cfe448c6a8 Mon Sep 17 00:00:00 2001
|
|
From: Muthu Subramanian <sumuthu@collabora.com>
|
|
Date: Wed, 23 Apr 2014 18:33:22 +0530
|
|
Subject: [PATCH] fdo#64047: n#863021: Add set-all language menu.
|
|
|
|
Problems:
|
|
* Doesn't reset the spell error markers
|
|
* Modifies only at object level
|
|
* Currently has only setting for 'all text'
|
|
* Maybe provide a current slide only option?
|
|
|
|
Change-Id: I4695423fed3ed9422185b23803eedd12ef434bea
|
|
(cherry picked from commit 0833f4046a1afa77aeed97a131c5325c44be1bb3)
|
|
Signed-off-by: Andras Timar <andras.timar@collabora.com>
|
|
---
|
|
sd/sdi/_docsh.sdi | 15 ++--
|
|
sd/source/ui/docshell/docshel3.cxx | 114 +++++++++++++++++++++++++++++++
|
|
sd/source/ui/docshell/docshell.cxx | 6 ++
|
|
sd/uiconfig/sdraw/menubar/menubar.xml | 2 +
|
|
sd/uiconfig/simpress/menubar/menubar.xml | 2 +
|
|
5 files changed, 134 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
|
|
index 075b60a..b087723 100644
|
|
--- a/sd/sdi/_docsh.sdi
|
|
+++ b/sd/sdi/_docsh.sdi
|
|
@@ -32,11 +32,16 @@ interface DrawDocument
|
|
ExecMethod = Execute ;
|
|
StateMethod = GetState ;
|
|
]
|
|
- SID_CHINESE_CONVERSION // ole : ?, status : ?
|
|
- [
|
|
- ExecMethod = Execute ;
|
|
- StateMethod = GetState ;
|
|
- ]
|
|
+ SID_CHINESE_CONVERSION // ole : ?, status : ?
|
|
+ [
|
|
+ ExecMethod = Execute ;
|
|
+ StateMethod = GetState ;
|
|
+ ]
|
|
+ SID_LANGUAGE_STATUS
|
|
+ [
|
|
+ ExecMethod = Execute ;
|
|
+ StateMethod = GetState ;
|
|
+ ]
|
|
// ?
|
|
FID_SEARCH_NOW // ole : ?, status : ?
|
|
[
|
|
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
|
|
index d22f50a..cd45b39 100644
|
|
--- a/sd/source/ui/docshell/docshel3.cxx
|
|
+++ b/sd/source/ui/docshell/docshel3.cxx
|
|
@@ -17,6 +17,7 @@
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
*/
|
|
|
|
+#include "Window.hxx"
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#include "app.hrc"
|
|
@@ -28,11 +29,18 @@
|
|
#include <svx/svxerr.hxx>
|
|
#include <svx/dialmgr.hxx>
|
|
#include <svl/srchitem.hxx>
|
|
+#include <svl/languageoptions.hxx>
|
|
+#include <svtools/langtab.hxx>
|
|
#include <svx/srchdlg.hxx>
|
|
#include <sfx2/request.hxx>
|
|
+#include <sfx2/sfxdlg.hxx>
|
|
+#include <vcl/abstdlg.hxx>
|
|
+#include <vcl/window.hxx>
|
|
#include <svl/style.hxx>
|
|
#include <svx/drawitem.hxx>
|
|
#include <editeng/unolingu.hxx>
|
|
+#include <editeng/langitem.hxx>
|
|
+#include <editeng/eeitem.hxx>
|
|
#include <com/sun/star/i18n/TextConversionOption.hpp>
|
|
|
|
#include "strings.hrc"
|
|
@@ -55,6 +63,68 @@ using namespace ::com::sun::star::uno;
|
|
|
|
namespace sd {
|
|
|
|
+static void lcl_setLanguageForObj( SdrObject *pObj, LanguageType nLang, bool bLanguageNone = false )
|
|
+{
|
|
+ const sal_uInt16 aLangWhichId_EE[3] =
|
|
+ {
|
|
+ EE_CHAR_LANGUAGE,
|
|
+ EE_CHAR_LANGUAGE_CJK,
|
|
+ EE_CHAR_LANGUAGE_CTL
|
|
+ };
|
|
+
|
|
+ if( bLanguageNone )
|
|
+ nLang = LANGUAGE_NONE;
|
|
+
|
|
+ if( nLang != LANGUAGE_DONTKNOW )
|
|
+ {
|
|
+ if( nLang == LANGUAGE_NONE )
|
|
+ {
|
|
+ for(sal_Int32 n = 0; n < 3; n++ )
|
|
+ pObj->SetMergedItem( SvxLanguageItem( nLang, aLangWhichId_EE[n] ) );
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ sal_uInt16 nLangWhichId = 0;
|
|
+ sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang );
|
|
+ switch (nScriptType)
|
|
+ {
|
|
+ case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE; break;
|
|
+ case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
|
|
+ case SCRIPTTYPE_COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
|
|
+ default:
|
|
+ OSL_FAIL("unexpected case" );
|
|
+ return;
|
|
+ }
|
|
+ pObj->SetMergedItem( SvxLanguageItem( nLang, nLangWhichId ) );
|
|
+ }
|
|
+ }
|
|
+ else // Reset to default
|
|
+ {
|
|
+ for( sal_Int32 n = 0; n < 3; n++ )
|
|
+ pObj->ClearMergedItem( aLangWhichId_EE[n] );
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
+static void lcl_setLanguage( const SdDrawDocument *pDoc, const OUString &rLanguage, bool bLanguageNone = false )
|
|
+{
|
|
+ LanguageType nLang = SvtLanguageTable().GetType( rLanguage );
|
|
+
|
|
+ // Do it for SdDrawDocument->SetLanguage as well?
|
|
+
|
|
+ sal_uInt16 nPageCount = pDoc->GetPageCount(); // Pick All Pages
|
|
+ for( sal_uInt16 nPage = 0; nPage < nPageCount; nPage++ )
|
|
+ {
|
|
+ const SdrPage *pPage = pDoc->GetPage( nPage );
|
|
+ sal_uIntPtr nObjCount = pPage->GetObjCount();
|
|
+ for( sal_uInt16 nObj = 0; nObj < nObjCount; nObj++ )
|
|
+ {
|
|
+ SdrObject *pObj = pPage->GetObj( nObj );
|
|
+ lcl_setLanguageForObj( pObj, nLang, bLanguageNone );
|
|
+ }
|
|
+ }
|
|
+}
|
|
+
|
|
/**
|
|
* Handles SFX-Requests
|
|
*/
|
|
@@ -201,6 +271,50 @@ void DrawDocShell::Execute( SfxRequest& rReq )
|
|
}
|
|
}
|
|
break;
|
|
+ case SID_LANGUAGE_STATUS:
|
|
+ {
|
|
+ OUString aNewLangTxt;
|
|
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS , false );
|
|
+ if (pItem)
|
|
+ aNewLangTxt = pItem->GetValue();
|
|
+ if (aNewLangTxt == "*" )
|
|
+ {
|
|
+ // open the dialog "Tools/Options/Language Settings - Language"
|
|
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
|
|
+ if (pFact && mpViewShell)
|
|
+ {
|
|
+ VclAbstractDialog* pDlg = pFact->CreateVclDialog( mpViewShell->GetActiveWindow(), SID_LANGUAGE_OPTIONS );
|
|
+ pDlg->Execute();
|
|
+ delete pDlg;
|
|
+ }
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ // setting the new language...
|
|
+ if (!aNewLangTxt.isEmpty())
|
|
+ {
|
|
+ const OUString aDocumentLangPrefix("Default_");
|
|
+ const OUString aStrNone("LANGUAGE_NONE");
|
|
+ const OUString aStrResetLangs("RESET_LANGUAGES");
|
|
+ sal_Int32 nPos = -1;
|
|
+ if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix , 0 )))
|
|
+ {
|
|
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ break;
|
|
+ }
|
|
+ if (aNewLangTxt == aStrNone)
|
|
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString() );
|
|
+ else if (aNewLangTxt == aStrResetLangs)
|
|
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString(), true );
|
|
+ else
|
|
+ lcl_setLanguage( mpViewShell->GetDoc(), aNewLangTxt );
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ break;
|
|
|
|
default:
|
|
break;
|
|
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
|
|
index 1553954..ee0fad0 100644
|
|
--- a/sd/source/ui/docshell/docshell.cxx
|
|
+++ b/sd/source/ui/docshell/docshell.cxx
|
|
@@ -270,6 +270,12 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
|
|
rSet.Put(SfxVisibilityItem(nWhich, SvtCJKOptions().IsAnyEnabled()));
|
|
}
|
|
break;
|
|
+ case SID_LANGUAGE_STATUS:
|
|
+ {
|
|
+ // Keeping this enabled for the time being
|
|
+ rSet.Put(SfxVisibilityItem(nWhich, true));
|
|
+ }
|
|
+ break;
|
|
|
|
default:
|
|
break;
|
|
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
|
|
index 6e8f9e4..289acf9 100644
|
|
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
|
|
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
|
|
@@ -245,6 +245,8 @@
|
|
<menu:menuitem menu:id=".uno:SpellDialog"/>
|
|
<menu:menu menu:id=".uno:LanguageMenu">
|
|
<menu:menupopup>
|
|
+ <menu:menuitem menu:id=".uno:SetLanguageAllTextMenu"/>
|
|
+ <menu:menuseparator/>
|
|
<menu:menuitem menu:id=".uno:HangulHanjaConversion"/>
|
|
<menu:menuitem menu:id=".uno:ChineseConversion"/>
|
|
<menu:menuitem menu:id=".uno:ThesaurusDialog"/>
|
|
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
|
|
index b2d5ae6..e8b1a6d 100644
|
|
--- a/sd/uiconfig/simpress/menubar/menubar.xml
|
|
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
|
|
@@ -273,6 +273,8 @@
|
|
<menu:menuitem menu:id=".uno:SpellDialog"/>
|
|
<menu:menu menu:id=".uno:LanguageMenu">
|
|
<menu:menupopup>
|
|
+ <menu:menuitem menu:id=".uno:SetLanguageAllTextMenu"/>
|
|
+ <menu:menuseparator/>
|
|
<menu:menuitem menu:id=".uno:HangulHanjaConversion"/>
|
|
<menu:menuitem menu:id=".uno:ChineseConversion"/>
|
|
<menu:menuitem menu:id=".uno:ThesaurusDialog"/>
|
|
--
|
|
1.8.4.5
|
|
|