diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-09-27 10:49:38 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-30 10:48:58 +0000 |
commit | a0114eff777c343a16f13c4e6a99d63ef235cdc7 (patch) | |
tree | 42483b569f90d9f35706757c412f95e6a55b9b66 /sd/source | |
parent | e5c370e53d8701d863d231c26ce8e5c46385e5eb (diff) |
Convert Draw char dialog to widget UI
Conflicts:
sd/UIConfig_sdraw.mk
Change-Id: I1635e21d3bcfa708b4e6b99e5ec5bd00448e1f59
Reviewed-on: https://gerrit.libreoffice.org/6054
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/dlg/dlg_char.src | 84 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgchar.cxx | 42 | ||||
-rw-r--r-- | sd/source/ui/inc/dlg_char.hrc | 21 | ||||
-rw-r--r-- | sd/source/ui/inc/dlg_char.hxx | 6 |
4 files changed, 24 insertions, 129 deletions
diff --git a/sd/source/ui/dlg/dlg_char.src b/sd/source/ui/dlg/dlg_char.src deleted file mode 100644 index 37be74a50ca8..000000000000 --- a/sd/source/ui/dlg/dlg_char.src +++ /dev/null @@ -1,84 +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/dialogs.hrc> -#include "dlg_char.hrc" -TabDialog TAB_CHAR -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 176 ) ; - Text [ en-US ] = "Character" ; - Moveable = TRUE ; - // Closeable = TRUE; // Dieser Dialog enthaelt OK und/oder Cancel Button (KH) - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_CHAR_NAME ; - Text [ en-US ] = "Font" ; - PageResID = RID_SVXPAGE_CHAR_NAME ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_EFFECTS ; - Text [ en-US ] = "Font Effects" ; - PageResID = RID_SVXPAGE_CHAR_EFFECTS ; - }; - PageItem - { - Identifier = RID_SVXPAGE_CHAR_POSITION ; - PageResID = RID_SVXPAGE_CHAR_POSITION ; - Text [ en-US ] = "Position"; - }; - }; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 6 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 60 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 114 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton 1 - { - Pos = MAP_APPFONT ( 169 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "Return" ; - TabStop = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx index 93821a3c9eb4..05f76fc49d3e 100644 --- a/sd/source/ui/dlg/dlgchar.cxx +++ b/sd/source/ui/dlg/dlgchar.cxx @@ -21,6 +21,7 @@ #include <editeng/flstitem.hxx> #include <svx/flagsdef.hxx> #include <sfx2/objsh.hxx> +#include <svx/svxdlg.hxx> #include "sdresid.hxx" #include "dlg_char.hxx" @@ -32,14 +33,19 @@ */ SdCharDlg::SdCharDlg( Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell ) : - SfxTabDialog ( pParent, SdResId( TAB_CHAR ), pAttr ), + SfxTabDialog ( pParent + ,"DrawCharDialog" + ,"modules/sdraw/ui/drawchardialog.ui" + , pAttr ), rDocShell ( *pDocShell ) { - FreeResource(); - AddTabPage( RID_SVXPAGE_CHAR_NAME ); - AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); - AddTabPage( RID_SVXPAGE_CHAR_POSITION ); + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "Dialogdiet fail!"); + + mnCharName = AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 ); + mnCharEffects = AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 ); + mnCharPosition = AddTabPage( "RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 ); } // ----------------------------------------------------------------------- @@ -47,25 +53,17 @@ SdCharDlg::SdCharDlg( Window* pParent, const SfxItemSet* pAttr, void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - switch( nId ) + if (nId == mnCharName) { - case RID_SVXPAGE_CHAR_NAME: - { - SvxFontListItem aItem(*( (const SvxFontListItem*) - ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); - - aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); - rPage.PageCreated(aSet); - } - break; - - case RID_SVXPAGE_CHAR_EFFECTS: - aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); - rPage.PageCreated(aSet); - break; + SvxFontListItem aItem(*( (const SvxFontListItem*) ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); - default: - break; + aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); + rPage.PageCreated(aSet); + } + else if (nId == mnCharEffects) + { + aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); + rPage.PageCreated(aSet); } } diff --git a/sd/source/ui/inc/dlg_char.hrc b/sd/source/ui/inc/dlg_char.hrc deleted file mode 100644 index fe7d01557a74..000000000000 --- a/sd/source/ui/inc/dlg_char.hrc +++ /dev/null @@ -1,21 +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 . - */ -#define TAB_CHAR 20600 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/dlg_char.hxx b/sd/source/ui/inc/dlg_char.hxx index 45e93e0b66f1..962d973f71ed 100644 --- a/sd/source/ui/inc/dlg_char.hxx +++ b/sd/source/ui/inc/dlg_char.hxx @@ -23,8 +23,6 @@ #include <sfx2/tabdlg.hxx> -#include "dlg_char.hrc" - class SfxItemSet; class SfxObjectShell; @@ -35,6 +33,10 @@ class SfxObjectShell; class SdCharDlg : public SfxTabDialog { private: + sal_uInt16 mnCharName; + sal_uInt16 mnCharEffects; + sal_uInt16 mnCharPosition; + const SfxObjectShell& rDocShell; virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); |