[Libreoffice-commits] core.git: 3 commits - cui/source sc/qa sw/source

Laurent Godard lgodard.libre at laposte.net
Thu Oct 24 07:22:56 PDT 2013


 cui/source/tabpages/paragrph.cxx                    |   89 --------------------
 sc/qa/complex/cellRanges/CheckXCellRangesQuery.java |   15 ++-
 sw/source/ui/docvw/edtwin.cxx                       |   27 ++++++
 3 files changed, 41 insertions(+), 90 deletions(-)

New commits:
commit 55d4d0a749ae1430f65bb0a127c1b2b9251044d2
Author: Laurent Godard <lgodard.libre at laposte.net>
Date:   Thu Oct 24 16:16:36 2013 +0200

    avoid localization issue
    
    use the sheet name to build the expected strings
    
    Change-Id: I5f079975921338b9449186cc33a0acde180679d5
    Reviewed-on: https://gerrit.libreoffice.org/6419
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java b/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java
index d7aac7ef..5039c2d7 100644
--- a/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java
+++ b/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java
@@ -47,6 +47,8 @@ import org.junit.Test;
 import org.openoffice.test.OfficeConnection;
 import static org.junit.Assert.*;
 
+import com.sun.star.container.XNamed;
+
 /**
  * Check the XCellRangesQuery interface on the SheetCell service. test was
  * created for bug i20044.
@@ -55,6 +57,7 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
     XSpreadsheetDocument m_xSheetDoc = null;
     XCellRangesQuery m_xCell = null;
     XSpreadsheet m_xSpreadSheet = null;
+    String sSheetName = "";
 
     /**
      * Get all test methods.
@@ -92,6 +95,10 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
             m_xSpreadSheet = (XSpreadsheet) AnyConverter.toObject(
                     new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
 
+            // get the first sheet name
+            XNamed m_xNamed = (XNamed) AnyConverter.toObject(new Type(XNamed.class),m_xSpreadSheet);
+            sSheetName = m_xNamed.getName();
+
             // get the cell
             System.out.println("Getting a cell from sheet") ;
             oObj = m_xSpreadSheet.getCellByPosition(2, 3);
@@ -167,9 +174,9 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
     @Test public void checkEmptyCell() {
         System.out.println("Checking an empty cell...");
         // compare an empty cell with a cell with a value
-        assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"));
+        assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences(sSheetName+".C4"));
         // compare an empty cell with a cell with a value
-        assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"));
+        assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences(sSheetName+".C4"));
         // try to get this cell
 //         assertTrue("\tQuery empty cells did not return the correct value.", _queryEmptyCells("Sheet1.C4"));
         System.out.println("...done");
@@ -195,9 +202,9 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
         }
 
         // compare an cell with value 5 with a cell with value 15
-        assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"));
+        assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences(sSheetName + ".C4"));
         // compare an cell with value 5 with a cell with value 15
-        assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"));
+        assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences(sSheetName+".C4"));
         // try to get nothing
         assertTrue("\tQuery empty cells did not return the correct value.", _queryEmptyCells(""));
         System.out.println("...done");
commit 8e1bafcc37742073edacf53508057034a0e534ca
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 24 17:21:31 2013 +0300

    Don't allow selection handle movement to wrap
    
    Change-Id: Idc189a84da1aa0ac510e003134580eafc03b4b9a

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3a71de7..ffbd5f6 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2671,6 +2671,11 @@ static bool lcl_urlOverBackground(SwWrtShell& rSh, const Point& rDocPos)
 
 #if !HAVE_FEATURE_DESKTOP
 
+// As such these two functions could be more or less anywhere, I have
+// them now in this source file because the act of moving a selection
+// end point is somewhat the same as what happens when one
+// shift-clicks on either side of an existing selection.
+
 void touch_lo_selection_start_move_impl(const void *documentHandle,
                                         int x,
                                         int y)
@@ -2686,6 +2691,17 @@ void touch_lo_selection_start_move_impl(const void *documentHandle,
 
     const Point aDocPos( pOut->PixelToLogic( Point(x, y) ) );
 
+    // Don't allow moving the start of the selection beyond the end
+    // (point) of the selection.
+
+    SwRect startCharRect;
+    pWrtShell->GetCharRectAt(startCharRect, pWrtShell->GetCrsr()->GetPoint());
+    const Point startCharPos = startCharRect.Center();
+
+    if (startCharPos.Y() < aDocPos.Y() ||
+        (startCharPos.Y() == aDocPos.Y() && startCharPos.X() - startCharRect.Width() <= aDocPos.X()))
+        return;
+
     pWrtShell->ChgCurrPam( aDocPos );
 
     // Keep mark normally at the start and point at the end,
@@ -2713,6 +2729,17 @@ void touch_lo_selection_end_move_impl(const void *documentHandle,
 
     const Point aDocPos( pOut->PixelToLogic( Point(x, y) ) );
 
+    // Don't allow moving the end of the selection beyond the start
+    // (mark) of the selection.
+
+    SwRect endCharRect;
+    pWrtShell->GetCharRectAt(endCharRect, pWrtShell->GetCrsr()->GetMark());
+    const Point endCharPos = endCharRect.Center();
+
+    if (endCharPos.Y() > aDocPos.Y() ||
+        (endCharPos.Y() == aDocPos.Y() && endCharPos.X() + endCharRect.Width() >= aDocPos.X()))
+        return;
+
     pWrtShell->ChgCurrPam( aDocPos );
 
     {
commit a2c9eaee63cd71c78cf57c590583e9e9d80edece
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 24 16:02:02 2013 +0300

    Bin ASCII graphics and superfluous vertical whitescape
    
    Change-Id: I68110e2ff632d0446c127e428623fecb62aa14c5

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 9aa0608..5854608 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -52,8 +52,6 @@
 #include <sfx2/request.hxx>
 #include <svl/intitem.hxx>
 
-// static ----------------------------------------------------------------
-
 static sal_uInt16 pStdRanges[] =
 {
     SID_ATTR_PARA_LINESPACE,        // 10033
@@ -81,14 +79,10 @@ static sal_uInt16 pExtRanges[] =
     0
 };
 
-// define ----------------------------------------------------------------
-
 #define MAX_DURCH 5670      // 10 cm makes sense as maximum interline lead
                             // according to BP
 #define FIX_DIST_DEF 283    // standard fix distance 0,5 cm
 
-// enum ------------------------------------------------------------------
-
 enum LineSpaceList
 {
     LLINESPACE_1    = 0,
@@ -101,8 +95,6 @@ enum LineSpaceList
     LLINESPACE_END
 };
 
-// C-Function ------------------------------------------------------------
-
 void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 );
 
 void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
@@ -148,7 +140,6 @@ void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
     }
 }
 
-
 sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
 {
     sal_uInt16 nHtmlMode = 0;
@@ -164,8 +155,6 @@ sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
 
 }
 
-// class SvxStdParagraphTabPage ------------------------------------------
-
 IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
@@ -204,15 +193,11 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 SfxTabPage* SvxStdParagraphTabPage::Create( Window* pParent, const SfxItemSet& rSet)
 {
     return new SvxStdParagraphTabPage( pParent, rSet );
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
 {
     SfxItemState eState = SFX_ITEM_UNKNOWN;
@@ -414,8 +399,6 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
     return bModified;
 }
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
 {
     SfxItemPool* pPool = rSet.GetPool();
@@ -581,7 +564,6 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
     else
         m_pLineDist->SetNoSelection();
 
-
     _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
     eItemState = rSet.GetItemState( _nWhich );
 
@@ -611,8 +593,6 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
     m_pLineDist->SaveValue();
 }
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::EnableRelativeMode()
 {
     DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no parent-set!" );
@@ -625,8 +605,6 @@ void SvxStdParagraphTabPage::EnableRelativeMode()
     bRelativeMode = sal_True;
 }
 
-// -----------------------------------------------------------------------
-
 int SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
 {
     ELRLoseFocusHdl( NULL );
@@ -636,8 +614,6 @@ int SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
     return LEAVE_PAGE;
 }
 
-// -----------------------------------------------------------------------
-
 SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,  const SfxItemSet& rAttr ) :
     SfxTabPage( pParent, "ParaIndentSpacing","cui/ui/paraindentspacing.ui", rAttr ),
 
@@ -685,9 +661,8 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,  const SfxItemS
 }
 
 SvxStdParagraphTabPage::~SvxStdParagraphTabPage()
-{}
-
-// -----------------------------------------------------------------------
+{
+}
 
 void SvxStdParagraphTabPage::EnableNegativeMode()
 {
@@ -698,15 +673,11 @@ void SvxStdParagraphTabPage::EnableNegativeMode()
     bNegativeIndents = sal_True;
 }
 
-// -----------------------------------------------------------------------
-
 sal_uInt16* SvxStdParagraphTabPage::GetRanges()
 {
     return pStdRanges;
 }
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::SetLineSpacing_Impl
 (
     const SvxLineSpacingItem &rAttr
@@ -773,8 +744,6 @@ void SvxStdParagraphTabPage::SetLineSpacing_Impl
     LineDistHdl_Impl( m_pLineDist );
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox )
 {
     switch( pBox->GetSelectEntryPos() )
@@ -842,8 +811,6 @@ IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox )
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG_INLINE_START(SvxStdParagraphTabPage, ModifyHdl_Impl)
 {
     UpdateExample_Impl();
@@ -851,8 +818,6 @@ IMPL_LINK_NOARG_INLINE_START(SvxStdParagraphTabPage, ModifyHdl_Impl)
 }
 IMPL_LINK_NOARG_INLINE_END(SvxStdParagraphTabPage, ModifyHdl_Impl)
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::Init_Impl()
 {
     m_pLineDist->SetSelectHdl(
@@ -880,8 +845,6 @@ void SvxStdParagraphTabPage::Init_Impl()
     m_pLineDistAtMetricBox->SetMax( m_pLineDistAtMetricBox->Normalize( nAbst ), eUnit );
 }
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::UpdateExample_Impl( sal_Bool bAll )
 {
     m_pExampleWin->SetFirstLineOfst( (short)m_pFLineIndent->Denormalize( m_pFLineIndent->GetValue( FUNIT_TWIP ) ) );
@@ -915,8 +878,6 @@ void SvxStdParagraphTabPage::UpdateExample_Impl( sal_Bool bAll )
     m_pExampleWin->Draw( bAll );
 }
 
-// -----------------------------------------------------------------------
-
 void SvxStdParagraphTabPage::EnableRegisterMode()
 {
     m_pRegisterCB->Show();
@@ -941,20 +902,17 @@ void SvxStdParagraphTabPage::SetPageWidth( sal_uInt16 nPageWidth )
     nWidth = nPageWidth;
 }
 
-
 void SvxStdParagraphTabPage::EnableAutoFirstLine()
 {
     m_pAutoCB->Show();
 }
 
-
 void    SvxStdParagraphTabPage::EnableAbsLineDist(long nMinTwip)
 {
     m_pLineDist->InsertEntry(sAbsDist);
     nMinFixDist = nMinTwip;
 }
 
-
 void    SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet)
 {
 
@@ -996,15 +954,12 @@ void    SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet)
                 EnableContextualMode();
 }
 
-
 #define LASTLINEPOS_DEFAULT     0
 #define LASTLINEPOS_LEFT        1
 
 #define LASTLINECOUNT_OLD       3
 #define LASTLINECOUNT_NEW       4
 
-// class SvxParaAlignTabPage ------------------------------------------------
-
 SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet )
 
     : SfxTabPage(pParent, "ParaAlignPage", "cui/ui/paragalignpage.ui",rSet)
@@ -1095,7 +1050,6 @@ SfxTabPage* SvxParaAlignTabPage::Create( Window* pParent, const SfxItemSet& rSet
 sal_uInt16* SvxParaAlignTabPage::GetRanges()
 {
     return pAlignRanges;
-
 }
 
 sal_Bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
@@ -1320,7 +1274,7 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl)
     return 0;
 }
 
-void    SvxParaAlignTabPage::UpdateExample_Impl( sal_Bool bAll )
+void SvxParaAlignTabPage::UpdateExample_Impl( sal_Bool bAll )
 {
     if ( m_pLeft->IsChecked() )
         m_pExampleWin->SetAdjust( SVX_ADJUST_LEFT );
@@ -1368,8 +1322,6 @@ SfxTabPage* SvxExtParagraphTabPage::Create( Window* pParent,
     return new SvxExtParagraphTabPage( pParent, rSet );
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
 {
     sal_Bool bModified = sal_False;
@@ -1505,7 +1457,6 @@ sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
         }
     }
 
-
     // paragraph split
     _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
     eState = m_pKeepTogetherBox->GetState();
@@ -1575,8 +1526,6 @@ sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
     return bModified;
 }
 
-// -----------------------------------------------------------------------
-
 void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
 {
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
@@ -1855,8 +1804,6 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
     m_pOrphanBox->SaveValue();
 }
 
-// -----------------------------------------------------------------------
-
 int SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
 {
     if ( _pSet )
@@ -1864,8 +1811,6 @@ int SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
     return LEAVE_PAGE;
 }
 
-// -----------------------------------------------------------------------
-
 void SvxExtParagraphTabPage::DisablePageBreak()
 {
     bPageBreak = sal_False;
@@ -1878,8 +1823,6 @@ void SvxExtParagraphTabPage::DisablePageBreak()
     m_pPagenumEdit->Enable(sal_False);
 }
 
-// -----------------------------------------------------------------------
-
 SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rAttr ) :
     SfxTabPage( pParent, "TextFlowPage","cui/ui/textflowpage.ui", rAttr ),
 
@@ -1907,7 +1850,6 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSe
     get(m_pBreakPositionFT,"labelPosition");
     get(m_pPagenumText,"labelPageNum");
 
-
     // Options
     get(m_pKeepTogetherBox,"checkSplitPara");
     get(m_pKeepParaBox,"checkKeepPara");
@@ -1975,21 +1917,15 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSe
     }
 }
 
-// -----------------------------------------------------------------------
-
 SvxExtParagraphTabPage::~SvxExtParagraphTabPage()
 {
 }
 
-// -----------------------------------------------------------------------
-
 sal_uInt16* SvxExtParagraphTabPage::GetRanges()
 {
     return pExtRanges;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageBreakHdl_Impl)
 {
     switch ( m_pPageBreakBox->GetState() )
@@ -2032,8 +1968,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageBreakHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, KeepTogetherHdl_Impl)
 {
     sal_Bool bEnable = m_pKeepTogetherBox->GetState() == STATE_NOCHECK;
@@ -2043,8 +1977,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, KeepTogetherHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, WidowHdl_Impl)
 {
     switch ( m_pWidowBox->GetState() )
@@ -2068,8 +2000,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, WidowHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, OrphanHdl_Impl)
 {
     switch( m_pOrphanBox->GetState() )
@@ -2093,8 +2023,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, OrphanHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, HyphenClickHdl_Impl)
 {
 
@@ -2110,8 +2038,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, HyphenClickHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK_NOARG(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl)
 {
     sal_Bool bEnable = sal_False;
@@ -2134,8 +2060,6 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl)
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox )
 {
     if ( 0 == pListBox->GetSelectEntryPos() )
@@ -2163,8 +2087,6 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox )
     return 0;
 }
 
-// -----------------------------------------------------------------------
-
 IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox )
 {
     //column break or break break after
@@ -2184,15 +2106,11 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox )
 
 void SvxExtParagraphTabPage::PageCreated(SfxAllItemSet aSet)
 {
-
-
     SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_False);
 
     if (pDisablePageBreakItem)
         if ( pDisablePageBreakItem->GetValue())
                     DisablePageBreak();
-
-
 }
 
 SvxAsianTabPage::SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet ) :
@@ -2279,7 +2197,6 @@ static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, CheckBox& rBo
     rBox.SaveValue();
 }
 
-
 void SvxAsianTabPage::Reset( const SfxItemSet& rSet )
 {
     lcl_SetBox(rSet, SID_ATTR_PARA_FORBIDDEN_RULES, *m_pForbiddenRulesCB );


More information about the Libreoffice-commits mailing list