[Libreoffice-commits] core.git: include/svx svx/inc svx/source

Caolán McNamara caolanm at redhat.com
Mon Dec 22 06:48:49 PST 2014


 include/svx/dialogs.hrc                 |   17 ++-
 svx/inc/fontworkgallery.hrc             |   45 ----------
 svx/inc/helpid.hrc                      |    1 
 svx/source/tbxctrls/fontworkgallery.cxx |   58 +++----------
 svx/source/tbxctrls/fontworkgallery.src |  139 ++++++++++++--------------------
 5 files changed, 80 insertions(+), 180 deletions(-)

New commits:
commit 3aab42022bfdcad518f1d4ae4c6380745c0edf5f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 22 14:30:51 2014 +0000

    convert RID_SVXFLOAT_FONTWORK_ALIGNMENT resource to strings and images
    
    Change-Id: Id84a241971110a7e4edcf48e13ea8586bcd16e46

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index c95447c..fefec1a5 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -894,11 +894,6 @@
 #define RID_SVXSTR_DEPTH_3_INCH             (RID_SVX_START + 1000)
 #define RID_SVXSTR_DEPTH_4_INCH             (RID_SVX_START + 1001)
 
-#define RID_SVXFLOAT_FONTWORK_ALIGNMENT     (RID_SVX_START + 1002)
-
-/*  #i35426# DR 2004-10-19: (RID_SVX_START+1002) is
-    already used for RID_SVXFLOAT_FONTWORK_ALIGNMENT above. But these IDs describe floating
-    windows, and the following IDs are for strings, so this is no conflict. */
 #define RID_SVXSTR_PAGES                    (RID_SVX_START + 1002)
 
 #define RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE                (RID_SVX_START + 1118)
@@ -1084,9 +1079,19 @@
 #define RID_SVXIMG_LIGHTING_BRIGHT       (RID_SVX_START + 1365)
 #define RID_SVXIMG_LIGHTING_NORMAL       (RID_SVX_START + 1366)
 #define RID_SVXIMG_LIGHTING_DIM          (RID_SVX_START + 1367)
+#define RID_SVXSTR_ALIGN_LEFT            (RID_SVX_START + 1368)
+#define RID_SVXSTR_ALIGN_CENTER          (RID_SVX_START + 1369)
+#define RID_SVXSTR_ALIGN_RIGHT           (RID_SVX_START + 1370)
+#define RID_SVXSTR_ALIGN_WORD            (RID_SVX_START + 1371)
+#define RID_SVXSTR_ALIGN_STRETCH         (RID_SVX_START + 1372)
+#define RID_SVXIMG_FONTWORK_ALIGN_LEFT   (RID_SVX_START + 1373)
+#define RID_SVXIMG_FONTWORK_ALIGN_CENTER (RID_SVX_START + 1374)
+#define RID_SVXIMG_FONTWORK_ALIGN_RIGHT  (RID_SVX_START + 1375)
+#define RID_SVXIMG_FONTWORK_ALIGN_WORD   (RID_SVX_START + 1376)
+#define RID_SVXIMG_FONTWORK_ALIGN_STRETCH (RID_SVX_START + 1377)
 
 // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!!
-#define RID_SVXSTR_NEXTFREE              (RID_SVX_START + 1368)
+#define RID_SVXSTR_NEXTFREE              (RID_SVX_START + 1378)
 
 // if we have _a_lot_ time, we should group the resource ids by type, instead
 // of grouping them by semantics. The reason is that resource ids have to be
diff --git a/svx/inc/fontworkgallery.hrc b/svx/inc/fontworkgallery.hrc
deleted file mode 100644
index 115abb4..0000000
--- a/svx/inc/fontworkgallery.hrc
+++ /dev/null
@@ -1,45 +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>
-
-#define STR_ALIGN_LEFT                      1
-#define STR_ALIGN_CENTER                    2
-#define STR_ALIGN_RIGHT                     3
-#define STR_ALIGN_WORD                      4
-#define STR_ALIGN_STRETCH                   5
-#define STR_CHARS_SPACING_VERY_TIGHT        6
-#define STR_CHARS_SPACING_TIGHT             7
-#define STR_CHARS_SPACING_NORMAL            8
-#define STR_CHARS_SPACING_LOOSE             9
-#define STR_CHARS_SPACING_VERY_LOOSE        10
-#define STR_CHARS_SPACING_CUSTOM            11
-#define STR_CHARS_SPACING_KERN_PAIRS        12
-
-#define IMG_FONTWORK_ALIGN_LEFT_16          1
-#define IMG_FONTWORK_ALIGN_LEFT_26          3
-#define IMG_FONTWORK_ALIGN_CENTER_16        5
-#define IMG_FONTWORK_ALIGN_CENTER_26        7
-#define IMG_FONTWORK_ALIGN_RIGHT_16         9
-#define IMG_FONTWORK_ALIGN_RIGHT_26         11
-#define IMG_FONTWORK_ALIGN_WORD_16          13
-#define IMG_FONTWORK_ALIGN_WORD_26          15
-#define IMG_FONTWORK_ALIGN_STRETCH_16       17
-#define IMG_FONTWORK_ALIGN_STRETCH_26       19
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 588ec7d..6748139 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -83,7 +83,6 @@
 #define HID_MNU_ZOOM_WHOLE_PAGE                               "SVX_HID_MNU_ZOOM_WHOLE_PAGE"
 #define HID_POPUP_COLOR                                       "SVX_HID_POPUP_COLOR"
 #define HID_POPUP_COLOR_CTRL                                  "SVX_HID_POPUP_COLOR_CTRL"
-#define HID_POPUP_FONTWORK_ALIGN                              "SVX_HID_POPUP_FONTWORK_ALIGN"
 #define HID_POPUP_FRAME                                       "SVX_HID_POPUP_FRAME"
 #define HID_POPUP_LINE                                        "SVX_HID_POPUP_LINE"
 #define HID_POPUP_LINEEND                                     "SVX_HID_POPUP_LINEEND"
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 973809b..ea288f3 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -49,7 +49,6 @@
 
 #include <svx/fontworkgallery.hxx>
 #include "coreservices.hxx"
-#include "fontworkgallery.hrc"
 
 #include <algorithm>
 #include <boost/scoped_ptr.hpp>
@@ -299,7 +298,6 @@ public:
     FontworkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow );
 
     virtual void statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException ) SAL_OVERRIDE;
-    virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
 
 private:
     svt::ToolboxController& mrController;
@@ -317,34 +315,30 @@ private:
     void    implSetAlignment( int nAlignmentMode, bool bEnabled );
 };
 
-FontworkAlignmentWindow::FontworkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow )
-: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT ))
-, mrController( rController )
-, maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16    ) )
-, maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16  ) )
-, maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16   ) )
-, maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16    ) )
-, maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) )
-, msFontworkAlignment( ".uno:FontworkAlignment" )
-{
-    SetHelpId( HID_POPUP_FONTWORK_ALIGN );
+FontworkAlignmentWindow::FontworkAlignmentWindow(svt::ToolboxController& rController,
+    const Reference< XFrame >& rFrame, vcl::Window* pParentWindow)
+    : ToolbarMenu(rFrame, pParentWindow, WB_MOVEABLE|WB_CLOSEABLE|WB_HIDE|WB_3DLOOK)
+    , mrController(rController)
+    , maImgAlgin1(SVX_RES(RID_SVXIMG_FONTWORK_ALIGN_LEFT))
+    , maImgAlgin2(SVX_RES(RID_SVXIMG_FONTWORK_ALIGN_CENTER))
+    , maImgAlgin3(SVX_RES(RID_SVXIMG_FONTWORK_ALIGN_RIGHT))
+    , maImgAlgin4(SVX_RES(RID_SVXIMG_FONTWORK_ALIGN_WORD))
+    , maImgAlgin5(SVX_RES(RID_SVXIMG_FONTWORK_ALIGN_STRETCH))
+    , msFontworkAlignment(".uno:FontworkAlignment")
+{
     SetSelectHdl( LINK( this, FontworkAlignmentWindow, SelectHdl ) );
 
-    appendEntry( 0, SVX_RESSTR( STR_ALIGN_LEFT    ), maImgAlgin1 );
-    appendEntry( 1, SVX_RESSTR( STR_ALIGN_CENTER  ), maImgAlgin2 );
-    appendEntry( 2, SVX_RESSTR( STR_ALIGN_RIGHT   ), maImgAlgin3 );
-    appendEntry( 3, SVX_RESSTR( STR_ALIGN_WORD    ), maImgAlgin4 );
-    appendEntry( 4, SVX_RESSTR( STR_ALIGN_STRETCH ), maImgAlgin5 );
+    appendEntry(0, SVX_RESSTR(RID_SVXSTR_ALIGN_LEFT), maImgAlgin1);
+    appendEntry(1, SVX_RESSTR(RID_SVXSTR_ALIGN_CENTER), maImgAlgin2);
+    appendEntry(2, SVX_RESSTR(RID_SVXSTR_ALIGN_RIGHT), maImgAlgin3);
+    appendEntry(3, SVX_RESSTR(RID_SVXSTR_ALIGN_WORD), maImgAlgin4);
+    appendEntry(4, SVX_RESSTR(RID_SVXSTR_ALIGN_STRETCH), maImgAlgin5);
 
     SetOutputSizePixel( getMenuSize() );
 
-    FreeResource();
-
     AddStatusListener( msFontworkAlignment );
 }
 
-
-
 void FontworkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
 {
     int i;
@@ -355,8 +349,6 @@ void FontworkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
     }
 }
 
-
-
 void FontworkAlignmentWindow::statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException )
 {
     if( Event.FeatureURL.Main.equals( msFontworkAlignment ) )
@@ -374,24 +366,6 @@ void FontworkAlignmentWindow::statusChanged( const frame::FeatureStateEvent& Eve
     }
 }
 
-
-
-void FontworkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt )
-{
-    ToolbarMenu::DataChanged( rDCEvt );
-
-    if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
-    {
-        appendEntry( 0, SVX_RESSTR( STR_ALIGN_LEFT    ), maImgAlgin1 );
-        appendEntry( 1, SVX_RESSTR( STR_ALIGN_CENTER  ), maImgAlgin2 );
-        appendEntry( 2, SVX_RESSTR( STR_ALIGN_RIGHT   ), maImgAlgin3 );
-        appendEntry( 3, SVX_RESSTR( STR_ALIGN_WORD    ), maImgAlgin4 );
-        appendEntry( 4, SVX_RESSTR( STR_ALIGN_STRETCH ), maImgAlgin5 );
-    }
-}
-
-
-
 IMPL_LINK_NOARG(FontworkAlignmentWindow, SelectHdl)
 {
     if ( IsInPopupMode() )
diff --git a/svx/source/tbxctrls/fontworkgallery.src b/svx/source/tbxctrls/fontworkgallery.src
index 6bb56b1..dee254d 100644
--- a/svx/source/tbxctrls/fontworkgallery.src
+++ b/svx/source/tbxctrls/fontworkgallery.src
@@ -19,95 +19,62 @@
 
 #include "helpid.hrc"
 #include <svx/dialogs.hrc>
-#include "fontworkgallery.hrc"
-#include "svtools/controldims.hrc"
 
 #define MASKCOLOR   MaskColor = Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; };
 
-DockingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
-{
-    HelpID = "svx:DockingWindow:RID_SVXFLOAT_FONTWORK_ALIGNMENT";
-    Border = FALSE ;
-    Hide = TRUE ;
-    SVLook = TRUE ;
-    Sizeable = FALSE ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    Zoomable = TRUE ;
-
-    Text [ en-US ] = "Fontwork Alignment" ;
-
-    String STR_ALIGN_LEFT
-    {
-        Text [ en-US ] = "~Left Align";
-    };
-    String STR_ALIGN_CENTER
-    {
-        Text [ en-US ] = "~Center";
-    };
-    String STR_ALIGN_RIGHT
-    {
-        Text [ en-US ] = "~Right Align";
-    };
-    String STR_ALIGN_WORD
-    {
-        Text [ en-US ] = "~Word Justify";
-    };
-    String STR_ALIGN_STRETCH
-    {
-        Text [ en-US ] = "S~tretch Justify";
-    };
-
-    Image IMG_FONTWORK_ALIGN_LEFT_16
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignleft_16.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_LEFT_26
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignleft_26.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_CENTER_16
-    {
-        ImageBitmap = Bitmap { File = "fontworkaligncentered_16.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_CENTER_26
-    {
-        ImageBitmap = Bitmap { File = "fontworkaligncentered_26.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_RIGHT_16
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignright_16.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_RIGHT_26
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignright_26.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_WORD_16
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignjustified_16.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_WORD_26
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignjustified_26.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_STRETCH_16
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignstretch_16.png"; };
-        MASKCOLOR
-    };
-    Image IMG_FONTWORK_ALIGN_STRETCH_26
-    {
-        ImageBitmap = Bitmap { File = "fontworkalignstretch_26.png"; };
-        MASKCOLOR
-    };
+String RID_SVXSTR_ALIGN_LEFT
+{
+    Text [ en-US ] = "~Left Align";
+};
+
+String RID_SVXSTR_ALIGN_CENTER
+{
+    Text [ en-US ] = "~Center";
+};
+
+String RID_SVXSTR_ALIGN_RIGHT
+{
+    Text [ en-US ] = "~Right Align";
+};
+
+String RID_SVXSTR_ALIGN_WORD
+{
+    Text [ en-US ] = "~Word Justify";
+};
+
+String RID_SVXSTR_ALIGN_STRETCH
+{
+    Text [ en-US ] = "S~tretch Justify";
+};
+
+Image RID_SVXIMG_FONTWORK_ALIGN_LEFT
+{
+    ImageBitmap = Bitmap { File = "fontworkalignleft_16.png"; };
+    MASKCOLOR
+};
+
+Image RID_SVXIMG_FONTWORK_ALIGN_CENTER
+{
+    ImageBitmap = Bitmap { File = "fontworkaligncentered_16.png"; };
+    MASKCOLOR
+};
+
+Image RID_SVXIMG_FONTWORK_ALIGN_RIGHT
+{
+    ImageBitmap = Bitmap { File = "fontworkalignright_16.png"; };
+    MASKCOLOR
+};
+
+Image RID_SVXIMG_FONTWORK_ALIGN_WORD
+{
+    ImageBitmap = Bitmap { File = "fontworkalignjustified_16.png"; };
+    MASKCOLOR
+};
+
+Image RID_SVXIMG_FONTWORK_ALIGN_STRETCH
+{
+    ImageBitmap = Bitmap { File = "fontworkalignstretch_16.png"; };
+    MASKCOLOR
 };
 
 String RID_SVXSTR_CHARS_SPACING_VERY_TIGHT


More information about the Libreoffice-commits mailing list