connectivity/source/drivers/odbcbase/OResultSet.cxx | 2 dbaccess/source/core/api/KeySet.cxx | 2 svx/source/fmcomp/gridctrl.cxx | 83 ++++++++++---------- 3 files changed, 46 insertions(+), 41 deletions(-)
New commits: commit 91fff62c87512e16d4f0446c337242e462dc2aec Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Nov 26 06:36:53 2012 +0100 Typo in comment Change-Id: I63e866d5ad6ae76c8e19d04f3be1476f82966e31 diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 2fa7eea..057ebc0 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -447,7 +447,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows static ::rtl::OUString aEqual(" = ?"); - // use keys and indexes for excat postioning + // use keys and indexes for exact postioning // first the keys Reference<XNameAccess> xKeyColumns = getKeyColumns(); commit ffdd9120403de0ff892fcc5e112de757c63e7630 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Nov 26 06:48:16 2012 +0100 Assert that length of bookmark has not changed after editing line TODO actually handle such a change Change-Id: I1cd6b92a44d50e95c5d1408a01962d49a0ab3e83 diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index 96d7d8e..4a04f06 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -924,6 +924,8 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) &nRealLen ); fillNeededData(nRet = N3SQLBulkOperations(m_aStatementHandle, SQL_UPDATE_BY_BOOKMARK)); + // LEM TODO: need to allow for change of not only bookmark value, but also bookmark length + assert(nRealLen == m_aBookmark.getLength()); } else fillNeededData(nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_UPDATE,SQL_LOCK_NO_CHANGE)); commit 25156680b5228bf72d4061e9052d15518c638418 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Nov 25 11:29:37 2012 +0100 rearrange controls on table data view navigation bar The settings for font size confused pixels and points ----> correct that with the kind help of Kendy and Thorsten. When font size was adjusted, control width was not recomputed ----> first change font size, then compute widths. First label glued to left of bar ----> add 1 pixel of space. In "row number" text entry area, center the text horizontally. In "row count" label: - justify text to the left for a "complete sentence" emulation with the other controls - use thousands separators + adapt width for that Less space between last button and scroll bar. A bit less space between controls in general. Change-Id: I2bb1e52d9555ecb054f16f762cf4ed5040814f10 diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 4d993b3..4192340 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -372,9 +372,9 @@ void DbGridControl::NavigationBar::PositionDataSource(sal_Int32 nRecord) DbGridControl::NavigationBar::NavigationBar(Window* pParent, WinBits nStyle) :Control(pParent, nStyle) ,m_aRecordText(this, WB_VCENTER) - ,m_aAbsolute(this, WB_VCENTER) + ,m_aAbsolute(this, WB_CENTER | WB_VCENTER) ,m_aRecordOf(this, WB_VCENTER) - ,m_aRecordCount(this, WB_CENTER | WB_VCENTER) + ,m_aRecordCount(this, WB_VCENTER) ,m_aFirstBtn(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS) ,m_aPrevBtn(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS) ,m_aNextBtn(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS) @@ -453,65 +453,68 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() { // Positionierung der Controls // Basisgroessen ermitteln - sal_uInt16 nX = 0; - sal_uInt16 nY = 0; Rectangle aRect(((DbGridControl*)GetParent())->GetControlArea()); const long nH = aRect.GetSize().Height(); - Size aBorder = LogicToPixel(Size(3, 3),MAP_APPFONT); - aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height())); + Size aBorder = LogicToPixel(Size(2, 2),MAP_APPFONT); + aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height())); + sal_uInt16 nX = 1; + sal_uInt16 nY = 0; + + // Ist der Font des Edits groesser als das Feld? + if (m_aAbsolute.GetTextHeight() > nH) + { + Font aApplFont (m_aAbsolute.GetFont()); + const Size pointAbsoluteSize(m_aAbsolute.PixelToLogic( Size( 0, nH - 2 ), MapMode(MAP_POINT) )); + aApplFont.SetSize( pointAbsoluteSize ); + m_aAbsolute.SetControlFont( aApplFont ); + + aApplFont.SetTransparent( sal_True ); + m_aRecordText.SetControlFont( aApplFont ); + m_aRecordOf.SetControlFont( aApplFont ); + m_aRecordCount.SetControlFont( aApplFont ); + } // Controls Groessen und Positionen setzen // - XubString aText = m_aRecordText.GetText(); + XubString aText = m_aRecordText.GetText(); long nTextWidth = m_aRecordText.GetTextWidth(aText); - m_aRecordText.SetPosPixel(Point(nX,nY) ); + m_aRecordText.SetPosPixel(Point(nX,nY)); m_aRecordText.SetSizePixel(Size(nTextWidth,nH)); nX = sal::static_int_cast< sal_uInt16 >(nX + nTextWidth + aBorder.Width()); - m_aAbsolute.SetPosPixel( Point(nX,nY)); - m_aAbsolute.SetSizePixel( Size(3*nH,aRect.GetSize().Height()) ); // Heuristik XXXXXXX - nX = sal::static_int_cast< sal_uInt16 >(nX + (3*nH) + aBorder.Width()); + // count an extra hairspace (U+200A) left and right + const rtl::OUString sevenDigits(m_aAbsolute.CreateFieldText(6000000)); + const rtl::OUString hairSpace(static_cast<sal_Unicode>(0x200A)); + rtl::OUString textPattern(hairSpace); + textPattern += sevenDigits; + textPattern += hairSpace; + nTextWidth = m_aAbsolute.GetTextWidth( textPattern ); + m_aAbsolute.SetPosPixel(Point(nX,nY)); + m_aAbsolute.SetSizePixel(Size(nTextWidth, nH)); + nX = sal::static_int_cast< sal_uInt16 >(nX + nTextWidth + aBorder.Width()); aText = m_aRecordOf.GetText(); nTextWidth = m_aRecordOf.GetTextWidth(aText); - m_aRecordOf.SetPosPixel(Point(nX,nY) ); + m_aRecordOf.SetPosPixel(Point(nX,nY)); m_aRecordOf.SetSizePixel(Size(nTextWidth,nH)); nX = sal::static_int_cast< sal_uInt16 >(nX + nTextWidth + aBorder.Width()); - nTextWidth = m_aRecordCount.GetTextWidth( rtl::OUString("0000000 (00000) *") ); - m_aRecordCount.SetPosPixel(Point(nX,nY) ); + textPattern = sevenDigits + " * (" + sevenDigits + ")"; + nTextWidth = m_aRecordCount.GetTextWidth( textPattern ); + m_aRecordCount.SetPosPixel(Point(nX,nY)); m_aRecordCount.SetSizePixel(Size(nTextWidth,nH)); nX = sal::static_int_cast< sal_uInt16 >(nX + nTextWidth + aBorder.Width()); Point aButtonPos(nX,nY); - Size aButtonSize(nH,nH); + const Size aButtonSize(nH,nH); SetPosAndSize(m_aFirstBtn, aButtonPos, aButtonSize); SetPosAndSize(m_aPrevBtn, aButtonPos, aButtonSize); SetPosAndSize(m_aNextBtn, aButtonPos, aButtonSize); SetPosAndSize(m_aLastBtn, aButtonPos, aButtonSize); SetPosAndSize(m_aNewBtn, aButtonPos, aButtonSize); - nX = sal::static_int_cast< sal_uInt16 >( - aButtonPos.X() + (sal_uInt16)(nH + aBorder.Width())); - - // Ist der Font des Edits groesser als das Feld? - Font aOutputFont = m_aAbsolute.GetFont(); - if (aOutputFont.GetSize().Height() > nH) - { - Font aApplFont = OutputDevice::GetDefaultFont( - DEFAULTFONT_SANS_UNICODE, - Application::GetSettings().GetUILanguageTag().getLanguageType(), - DEFAULTFONT_FLAGS_ONLYONE, - this - ); - aApplFont.SetSize( Size( 0, nH - 2 ) ); - m_aAbsolute.SetControlFont( aApplFont ); + nX = sal::static_int_cast< sal_uInt16 >(aButtonPos.X() + 1); - aApplFont.SetTransparent( sal_True ); - m_aRecordText.SetControlFont( aApplFont ); - m_aRecordOf.SetControlFont( aApplFont ); - m_aRecordCount.SetControlFont( aApplFont ); - } return nX; } @@ -561,7 +564,7 @@ void DbGridControl::NavigationBar::InvalidateAll(sal_Int32 nCurrentPos, sal_Bool sal_Int32 nAdjustedRowCount = pParent->GetRowCount() - ((pParent->GetOptions() & DbGridControl::OPT_INSERT) ? 2 : 1); - // Wann mu� alles invalidiert werden + // Wann muà alles invalidiert werden bAll = bAll || m_nCurrentPos <= 0; bAll = bAll || nCurrentPos <= 0; bAll = bAll || m_nCurrentPos >= nAdjustedRowCount; @@ -695,12 +698,12 @@ void DbGridControl::NavigationBar::SetState(sal_uInt16 nWhich) if (pParent->GetOptions() & DbGridControl::OPT_INSERT) { if (pParent->IsCurrentAppending() && !pParent->IsModified()) - aText = String::CreateFromInt32(pParent->GetRowCount()); + aText = m_aAbsolute.CreateFieldText(pParent->GetRowCount()); else - aText = String::CreateFromInt32(pParent->GetRowCount() - 1); + aText = m_aAbsolute.CreateFieldText(pParent->GetRowCount() - 1); } else - aText = String::CreateFromInt32(pParent->GetRowCount()); + aText = m_aAbsolute.CreateFieldText(pParent->GetRowCount()); if(!pParent->m_bRecordCountFinal) aText += rtl::OUString(" *"); } @@ -712,7 +715,7 @@ void DbGridControl::NavigationBar::SetState(sal_uInt16 nWhich) { String aExtendedInfo(aText); aExtendedInfo.AppendAscii(" ("); - aExtendedInfo += String::CreateFromInt32(pParent->GetSelectRowCount()); + aExtendedInfo += m_aAbsolute.CreateFieldText(pParent->GetSelectRowCount()); aExtendedInfo += ')'; pWnd->SetText(aExtendedInfo); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits