[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: patch: kspread vertical alignment toolbar
From: Ariya Hidayat <ariya () kde ! org>
Date: 2003-11-01 18:15:58
[Download RAW message or body]
To reproduce the problem: click the top, middle, or bottom buttons in
the toolbar (to align the text in the cell vertically). It won't work.
The attached patch fixes this.
I will commit it if nobody objects.
Best regards,
Ariya Hidayat
http://ariya.pandu.org
["aligny.patch" (text/plain)]
--- kspread_format.h.orig 2003-04-10 19:36:55.000000000 +0200
+++ kspread_format.h 2003-11-02 02:38:26.000000000 +0100
@@ -46,7 +46,7 @@ class KSpreadFormat
{
public:
enum Align { Left = 1, Center = 2, Right = 3, Undefined = 4 };
- enum AlignY { Top = 1, Middle = 2, Bottom = 3 };
+ enum AlignY { Top = 1, Middle = 2, Bottom = 3, UndefinedY = 4 };
enum FloatFormat { AlwaysSigned = 1, AlwaysUnsigned = 2, OnlyNegSigned = 3 };
enum FloatColor { NegRed = 1, AllBlack = 2, NegBrackets = 3, NegRedBrackets = 4 };
enum FormatType { Number=0, Text_format=5, Money=10, Percentage=25, Scientific=30,
--- kspread_view.cc.orig 2003-10-24 05:43:26.000000000 +0200
+++ kspread_view.cc 2003-11-02 02:39:31.000000000 +0100
@@ -5758,18 +5758,13 @@ void KSpreadView::alignTop( bool b )
if ( m_toolbarLock )
return;
- m_pDoc->emitBeginOperation( false );
- if ( !b )
- {
- m_alignMiddle->setChecked( true );
- alignMiddle( true );
- endOperation( selectionInfo()->selection() );
- return;
- }
-
if ( m_pTable != 0L )
{
- m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Top );
+ m_pDoc->emitBeginOperation( false );
+ if ( !b )
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::UndefinedY );
+ else
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Top );
endOperation( selectionInfo()->selection() );
}
@@ -5780,18 +5775,13 @@ void KSpreadView::alignBottom( bool b )
if ( m_toolbarLock )
return;
- m_pDoc->emitBeginOperation( false );
- if ( !b )
- {
- m_alignMiddle->setChecked( true );
- alignMiddle( true );
- endOperation( selectionInfo()->selection() );
- return;
- }
-
if ( m_pTable != 0L )
{
- m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Bottom );
+ m_pDoc->emitBeginOperation( false );
+ if ( !b )
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::UndefinedY );
+ else
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Bottom );
endOperation( selectionInfo()->selection() );
}
@@ -5802,17 +5792,13 @@ void KSpreadView::alignMiddle( bool b )
if ( m_toolbarLock )
return;
- m_pDoc->emitBeginOperation( false );
- if ( !b )
- {
- m_alignMiddle->setChecked( true);
- endOperation( selectionInfo()->selection() );
- return;
- }
-
if ( m_pTable != 0L )
{
- m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Middle );
+ m_pDoc->emitBeginOperation( false );
+ if ( !b )
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::UndefinedY );
+ else
+ m_pTable->setSelectionAlignY( selectionInfo(), KSpreadFormat::Middle );
endOperation( selectionInfo()->selection() );
}
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic