diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-02-21 16:33:30 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-02-21 16:41:40 +0200 |
commit | 69c5252a63d6124a90b652c423dbf94d26fe196b (patch) | |
tree | 6995b842b5e06bd3ae30a9b601de5e94c38a284e /svx/source | |
parent | 144546b622fd6146e023efe27b74f1271ff47008 (diff) |
tdf#93837 Convert RID_FM_TEXTATTRIBUTE_MENU to xml
Change-Id: Ic37bfb9e25eba9b03b2c896c904823aec478355e
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/form/fmtextcontrolshell.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/formshell.src | 153 | ||||
-rw-r--r-- | svx/source/mnuctrls/fntctl.cxx | 149 | ||||
-rw-r--r-- | svx/source/mnuctrls/fntszctl.cxx | 184 |
4 files changed, 1 insertions, 487 deletions
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 97a8b9984e3f..e5c8aa54459a 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -1355,7 +1355,7 @@ namespace svx void FmTextControlShell::contextMenuRequested( const css::awt::MouseEvent& /*_rEvent*/ ) { - m_rBindings.GetDispatcher()->ExecutePopup( SVX_RES( RID_FM_TEXTATTRIBUTE_MENU ) ); + m_rBindings.GetDispatcher()->ExecutePopup( "formrichtext" ); } diff --git a/svx/source/form/formshell.src b/svx/source/form/formshell.src deleted file mode 100644 index 339cb17aae9d..000000000000 --- a/svx/source/form/formshell.src +++ /dev/null @@ -1,153 +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 "svx/fmresids.hrc" -#include <svx/svxids.hrc> -#include <svx/dialogs.hrc> -#include <sfx2/sfxsids.hrc> -#include "globlmn.hrc" -#include "helpid.hrc" -#include "fmhelp.hrc" - -Menu RID_FM_TEXTATTRIBUTE_MENU -{ - ItemList = - { - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_FONT - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_FONTHEIGHT - }; - MenuItem - { - Identifier = MENU_FM_TEXTATTRIBITES_STYLE; - HelpID = HID_MENU_FM_TEXTATTRIBUTES_STYLE; - Text [ en-US ] = "St~yle"; - SubMenu = Menu - { - ItemList = - { - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_WEIGHT - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_POSTURE - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_OVERLINE - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_UNDERLINE - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_STRIKEOUT - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_SHADOWED - }; - MenuItem - { - ITEM_FORMAT_ATTR_CHAR_CONTOUR - }; - MenuItem { Separator = TRUE; }; - MenuItem - { - ITEM_FORMAT_SET_SUPER_SCRIPT - }; - MenuItem - { - ITEM_FORMAT_SET_SUB_SCRIPT - }; - }; - }; - }; - MenuItem - { - Identifier = MENU_FM_TEXTATTRIBITES_ALIGNMENT; - HelpID = HID_MENU_FM_TEXTATTRIBUTES_ALIGNMENT; - Text [ en-US ] = "~Alignment"; - RadioCheck = TRUE; - SubMenu = Menu - { - ItemList = - { - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_ATTR_PARA_ADJUST_LEFT - }; - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_ATTR_PARA_ADJUST_RIGHT - }; - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_ATTR_PARA_ADJUST_CENTER - }; - MenuItem - { - ITEM_FORMAT_ATTR_PARA_ADJUST_BLOCK - RadioCheck = TRUE; - }; - }; - }; - }; - MenuItem - { - Identifier = MENU_FM_TEXTATTRIBITES_SPACING; - HelpID = HID_MENU_FM_TEXTATTRIBUTES_SPACING; - Text [ en-US ] = "~Line Spacing"; - _MenuItemFlags = MIB_RADIOCHECK; - SubMenu = Menu - { - ItemList = - { - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_PARA_LINESPACE_10 - }; - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_PARA_LINESPACE_15 - }; - MenuItem - { - RadioCheck = TRUE; - ITEM_FORMAT_PARA_LINESPACE_20 - }; - }; - }; - }; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx deleted file mode 100644 index ea92075faff7..000000000000 --- a/svx/source/mnuctrls/fntctl.cxx +++ /dev/null @@ -1,149 +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 <string> -#include <svtools/stdmenu.hxx> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/dispatch.hxx> - -#include <svx/fntctl.hxx> -#include <svx/svxids.hrc> -#include "editeng/flstitem.hxx" -#include "editeng/fontitem.hxx" - -SFX_IMPL_MENU_CONTROL(SvxFontMenuControl, SvxFontItem); - - -/* [Beschreibung] - - Ctor; setzt den Select-Handler am Men"u und tr"agt das Men"u - in seinen Parent ein. -*/ - -SvxFontMenuControl::SvxFontMenuControl -( - sal_uInt16 _nId, - Menu& rMenu, - SfxBindings& rBindings -) : - pMenu ( new FontNameMenu ), - rParent ( rMenu ) -{ - rMenu.SetPopupMenu( _nId, pMenu ); - pMenu->SetSelectHdl( LINK( this, SvxFontMenuControl, MenuSelect ) ); - StartListening( rBindings ); - FillMenu(); -} - - -/* [Beschreibung] - - F"ullt das Men"u mit den aktuellen Fonts aus der Fontlist - der DocumentShell. -*/ - -void SvxFontMenuControl::FillMenu() -{ - SfxObjectShell *pDoc = SfxObjectShell::Current(); - - if ( pDoc ) - { - const SvxFontListItem* pFonts = - static_cast<const SvxFontListItem*>(pDoc->GetItem( SID_ATTR_CHAR_FONTLIST )); - const FontList* pList = pFonts ? pFonts->GetFontList(): nullptr; - DBG_ASSERT( pList, "Kein Fonts gefunden" ); - pMenu->Fill( pList ); - } -} - - -/* [Beschreibung] - - Statusbenachrichtigung; - f"ullt ggf. das Men"u mit den aktuellen Fonts aus der Fontlist - der DocumentShell. - Ist die Funktionalit"at disabled, wird der entsprechende - Men"ueintrag im Parentmen"u disabled, andernfalls wird er enabled. - Der aktuelle Font wird mit einer Checkmark versehen. -*/ - -void SvxFontMenuControl::StateChanged( - - sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) - -{ - rParent.EnableItem( GetId(), SfxItemState::DISABLED != eState ); - - if ( SfxItemState::DEFAULT == eState ) - { - if ( !pMenu->GetItemCount() ) - FillMenu(); - const SvxFontItem* pFontItem = dynamic_cast<const SvxFontItem*>( pState ); - OUString aFont; - - if ( pFontItem ) - aFont = pFontItem->GetFamilyName(); - pMenu->SetCurName( aFont ); - } -} - - -/* [Beschreibung] - - Statusbenachrichtigung "uber Bindings; bei DOCCHANGED - wird das Men"u mit den aktuellen Fonts aus der Fontlist - der DocumentShell gef"ullt. -*/ - -void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint ) -{ - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint ); - if ( pSimpleHint && - pSimpleHint->GetId() == SFX_HINT_DOCCHANGED ) - FillMenu(); -} - - -/* [Beschreibung] - - Select-Handler des Men"us; der Name des selektierten Fonts - wird in einem SvxFontItem verschickt. Das F"ullen mit den - weiteren Fontinformationen mu\s durch die Applikation geschehen. -*/ - -IMPL_LINK_TYPED( SvxFontMenuControl, MenuSelect, FontNameMenu *, pMen, void ) -{ - SvxFontItem aItem( GetId() ); - aItem.SetFamilyName(pMen->GetCurName()); - GetBindings().GetDispatcher()->Execute( GetId(), SfxCallMode::RECORD, &aItem, 0L ); -} - -/* [Beschreibung] - - Dtor; gibt das Men"u frei. -*/ - -SvxFontMenuControl::~SvxFontMenuControl() -{ - delete pMenu; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/mnuctrls/fntszctl.cxx b/svx/source/mnuctrls/fntszctl.cxx deleted file mode 100644 index f4bc31e581f0..000000000000 --- a/svx/source/mnuctrls/fntszctl.cxx +++ /dev/null @@ -1,184 +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 <string> -#include <svl/itempool.hxx> -#include <svtools/stdmenu.hxx> -#include <svtools/ctrltool.hxx> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/viewfrm.hxx> -#include <sfx2/dispatch.hxx> - -#include <svx/fntszctl.hxx> -#include <svx/dialogs.hrc> -#include <editeng/fhgtitem.hxx> -#include "editeng/fontitem.hxx" -#include "editeng/flstitem.hxx" - -#include "svx/dlgutil.hxx" -#include <svx/dialmgr.hxx> - -#define LOGIC OutputDevice::LogicToLogic - -SFX_IMPL_MENU_CONTROL(SvxFontSizeMenuControl, SvxFontHeightItem); - - -/* [Beschreibung] - - Select-Handler des Men"us; die aktuelle Fontgr"o\se - wird in einem SvxFontHeightItem verschickt. -*/ - -IMPL_LINK_TYPED( SvxFontSizeMenuControl, MenuSelect, FontSizeMenu*, pMen, void ) -{ - SfxViewFrame* pFrm = SfxViewFrame::Current(); - SfxShell* pSh = pFrm ? pFrm->GetDispatcher()->GetShell( 0 ) : nullptr; - - if ( !pSh ) - return; - - const SfxItemPool& rPool = pSh->GetPool(); - sal_uInt16 nWhich = rPool.GetWhich( SID_ATTR_CHAR_FONTHEIGHT ); - const SfxMapUnit eUnit = rPool.GetMetric( nWhich ); - long nH = LOGIC( pMen->GetCurHeight(), MAP_POINT, (MapUnit)eUnit ) / 10; - SvxFontHeightItem aItem( nH, 100, GetId() ); - GetBindings().GetDispatcher()->Execute( GetId(), SfxCallMode::RECORD, &aItem, 0L ); -} - - -/* [Beschreibung] - - Statusbenachrichtigung; - Ist die Funktionalit"at disabled, wird der entsprechende - Men"ueintrag im Parentmenu disabled, andernfalls wird er enabled. - die aktuelle Fontgr"o\se wird mit einer Checkmark versehen. -*/ - -void SvxFontSizeMenuControl::StateChanged( - - sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) - -{ - rParent.EnableItem( GetId(), SfxItemState::DISABLED != eState ); - - if ( SfxItemState::DEFAULT == eState ) - { - if ( dynamic_cast<const SvxFontHeightItem*>( pState) != nullptr ) - { - const SvxFontHeightItem* pItem = - dynamic_cast<const SvxFontHeightItem*>( pState ); - long nVal = 0; - - if ( pItem ) - { - SfxViewFrame* pFrm = SfxViewFrame::Current(); - SfxShell* pSh = pFrm ? pFrm->GetDispatcher()->GetShell( 0 ) - : nullptr; - - if ( !pSh ) - return; - - const SfxItemPool& rPool = pSh->GetPool(); - sal_uInt16 nWhich = rPool.GetWhich( SID_ATTR_CHAR_FONTHEIGHT ); - const SfxMapUnit eUnit = rPool.GetMetric( nWhich ); - long nH = pItem->GetHeight() * 10; - nVal = LOGIC( nH, (MapUnit)eUnit, MAP_POINT ); - } - pMenu->SetCurHeight( nVal ); - } - else if ( dynamic_cast<const SvxFontItem*>( pState) != nullptr ) - { - const SvxFontItem* pItem = dynamic_cast<const SvxFontItem*>( pState ); - - if ( pItem ) - { - SfxObjectShell *pDoc = SfxObjectShell::Current(); - - if ( pDoc ) - { - const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>( - pDoc->GetItem( SID_ATTR_CHAR_FONTLIST )); - const FontList* pList = pFonts ? pFonts->GetFontList(): nullptr; - - if ( pList ) - { - FontMetric aFontMetric = pList->Get( pItem->GetFamilyName(), - pItem->GetStyleName() ); - pMenu->Fill( aFontMetric, pList ); - } - // else manche Shells haben keine Fontliste (z.B. Image) - } - } - } - } - else - { - // irgendwie muss man ja das Men"u f"ullen - SfxObjectShell* pSh = SfxObjectShell::Current(); - - if ( pSh ) - { - // daf"ur von der Shell eine Fontliste besorgen - const SvxFontListItem* pFonts = - static_cast<const SvxFontListItem*>(pSh->GetItem( SID_ATTR_CHAR_FONTLIST )); - const FontList* pList = pFonts ? pFonts->GetFontList(): nullptr; - if ( pList ) - pMenu->Fill( pList->GetFontName(0), pList ); - } - } -} - - -/* [Beschreibung] - - Ctor; setzt den Select-Handler am Men"u und tr"agt Men"u - in seinen Parent ein. -*/ - -SvxFontSizeMenuControl::SvxFontSizeMenuControl -( - sal_uInt16 _nId, - Menu& rMenu, - SfxBindings& rBindings -) : - SfxMenuControl( _nId, rBindings ), - - pMenu ( new FontSizeMenu ), - rParent ( rMenu ) - -{ - rMenu.SetPopupMenu( _nId, pMenu ); - pMenu->SetSelectHdl( LINK( this, SvxFontSizeMenuControl, MenuSelect ) ); -} - - -/* [Beschreibung] - - Dtor; gibt das Men"u frei. -*/ - -SvxFontSizeMenuControl::~SvxFontSizeMenuControl() -{ - delete pMenu; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |