summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-10-29 11:31:21 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-10-29 11:31:21 +0200
commiteba7ca82c2f08a7f9b7599330741119aad003473 (patch)
treeab152e07c1bf6781e5031a0bb2947e81a878dc58 /sc/source/ui/view
parent3d6f1fbb02ba073437cff962bd63ae35e18c0511 (diff)
parent5cb1bf1e0b4ad3d395c84bb24eb87c1a95954f8d (diff)
merge after pulling DEV300.m91
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/gridwin2.cxx17
-rw-r--r--sc/source/ui/view/gridwin4.cxx13
-rw-r--r--sc/source/ui/view/output2.cxx22
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx14
-rw-r--r--sc/source/ui/view/tabvwshb.cxx9
-rw-r--r--sc/source/ui/view/tabvwshf.cxx16
6 files changed, 41 insertions, 50 deletions
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index ec584213898c..669f1fda010d 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -145,7 +145,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent&
// Check if the mouse cursor is clicking on the popup arrow box.
mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY(), pDoc));
- mpFilterButton->setBoundingBox(aScrPos, aScrSize);
+ mpFilterButton->setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ mpFilterButton->setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
Point aPopupPos;
Size aPopupSize;
mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -371,6 +372,8 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove )
bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj)
{
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
// Get the geometry of the cell.
Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich);
long nSizeX, nSizeY;
@@ -379,7 +382,8 @@ bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddres
// Check if the mouse cursor is clicking on the popup arrow box.
ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings());
- aBtn.setBoundingBox(aScrPos, aScrSize);
+ aBtn.setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ aBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
Point aPopupPos;
Size aPopupSize;
aBtn.getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -520,9 +524,16 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
}
}
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
Rectangle aCellRect(rScrPos, rScrSize);
const Size& rPopupSize = mpDPFieldPopup->getWindowSize();
- if (rScrSize.getWidth() > rPopupSize.getWidth())
+ if (bLayoutRTL)
+ {
+ // RTL: rScrPos is logical-left (visual right) position, always right-align with that
+ aCellRect.SetPos(Point(rScrPos.X() - rPopupSize.Width() + 1, rScrPos.Y()));
+ }
+ else if (rScrSize.getWidth() > rPopupSize.getWidth())
{
// If the cell width is larger than the popup window width, launch it
// right-aligned with the cell.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index ba73fbf00269..372dcc582a45 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1291,7 +1291,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
- aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
aCellBtn.setDrawBaseButton(false);
aCellBtn.setDrawPopupButton(true);
aCellBtn.setHasHiddenMember(bArrowState);
@@ -1315,17 +1316,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
long nPosX = aScrPos.X();
long nPosY = aScrPos.Y();
- if ( bLayoutRTL )
- {
- // overwrite the right, not left (visually) grid as long as the
- // left/right colors of the button borders aren't mirrored.
- nPosX -= nSizeX - 2;
- }
+ // bLayoutRTL is handled in setBoundingBox
String aStr;
pDoc->GetString(nCol, nRow, nTab, aStr);
aCellBtn.setText(aStr);
- aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
aCellBtn.setDrawBaseButton(true);
aCellBtn.setDrawPopupButton(pInfo->bPopupButton);
aCellBtn.setHasHiddenMember(pInfo->bFilterActive);
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6d40d304fb13..61289cc7f931 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -80,7 +80,7 @@
#include <math.h>
//! Autofilter-Breite mit column.cxx zusammenfassen
-#define DROPDOWN_BITMAP_SIZE 17
+#define DROPDOWN_BITMAP_SIZE 18
#define DRAWTEXT_MAX 32767
@@ -1274,7 +1274,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
( static_cast<const ScMergeFlagAttr&>(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue() & SC_MF_AUTO ) &&
( !bBreak || pRefDevice == pFmtDevice ) )
{
- long nFilter = Min( nMergeSizeY, (long) DROPDOWN_BITMAP_SIZE );
+ // filter drop-down width is now independent from row height
+ const long nFilter = DROPDOWN_BITMAP_SIZE;
BOOL bFit = ( nNeeded + nFilter <= nMergeSizeX );
if ( bFit || bCellIsValue )
{
@@ -3516,20 +3517,11 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
eOrient!=SVX_ORIENTATION_STACKED &&
pInfo && pInfo->bAutoFilter)
{
- if (pRowInfo[nArrY].nHeight < DROPDOWN_BITMAP_SIZE)
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,pRowInfo[nArrY].nHeight)).Height();
- else
- nAvailWidth -= pRowInfo[nArrY].nHeight;
- }
+ // filter drop-down width is now independent from row height
+ if (bPixelToLogic)
+ nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
else
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
- else
- nAvailWidth -= DROPDOWN_BITMAP_SIZE;
- }
+ nAvailWidth -= DROPDOWN_BITMAP_SIZE;
long nComp = nEngineWidth;
if (nAvailWidth<nComp) nAvailWidth=nComp;
}
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index c291d01d71c2..ea06c1fe6c0c 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -44,7 +44,7 @@
#include <svl/ptitem.hxx>
#include <svl/stritem.hxx>
#include <tools/urlobj.hxx>
-
+#include <sfx2/objface.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/vclenum.hxx>
@@ -818,7 +818,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
pDlg->SetDescription(
String( ScResId( STR_DLG_SELECTTABLES_TITLE ) ),
String( ScResId( STR_DLG_SELECTTABLES_LBNAME ) ),
- SID_SELECT_TABLES, HID_SELECTTABLES );
+ GetStaticInterface()->GetSlot(SID_SELECT_TABLES)->GetCommand(), HID_SELECTTABLES );
// fill all table names with selection state
String aTabName;
@@ -1015,7 +1015,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
pDlg = new SfxPasswordDialog( GetDialogParent(), &aText );
pDlg->SetText( ScResId(SCSTR_UNPROTECTDOC) );
pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( FID_PROTECT_DOC );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
pDlg->SetEditHelpId( HID_PASSWD_DOC );
if (pDlg->Execute() == RET_OK)
@@ -1038,7 +1038,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
pDlg = new SfxPasswordDialog( GetDialogParent(), &aText );
pDlg->SetText( ScResId(SCSTR_PROTECTDOC) );
pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( FID_PROTECT_DOC );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
pDlg->SetEditHelpId( HID_PASSWD_DOC );
pDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
@@ -1089,7 +1089,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
auto_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( FID_PROTECT_TABLE );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
pDlg->SetEditHelpId( HID_PASSWD_TABLE );
if (pDlg->Execute() == RET_OK)
@@ -1161,7 +1161,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText));
pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( FID_PROTECT_TABLE );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
pDlg->SetEditHelpId( HID_PASSWD_TABLE );
if (pDlg->Execute() == RET_OK)
@@ -1183,7 +1183,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText));
pDlg->SetText( ScResId(SCSTR_PROTECTTAB) );
pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( FID_PROTECT_TABLE );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
pDlg->SetEditHelpId( HID_PASSWD_TABLE );
pDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 4b10a616c37c..38daeccfa617 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -314,7 +314,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
case SID_INSERT_PLUGIN:
case SID_INSERT_SOUND:
case SID_INSERT_VIDEO:
- case SID_INSERT_APPLET:
case SID_INSERT_SMATH:
case SID_INSERT_FLOATINGFRAME:
FuInsertOLE(this, pWin, pView, pDrModel, rReq);
@@ -471,14 +470,6 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
break;
- case SID_INSERT_APPLET:
- // wenn SOLAR_JAVA nicht definiert ist, immer disablen
-#ifdef SOLAR_JAVA
- if (bOle || bTabProt)
-#endif
- rSet.DisableItem( nWhich );
- break;
-
case SID_INSERT_GRAPHIC:
case SID_INSERT_AVMEDIA:
case SID_FONTWORK_GALLERY_FLOATER:
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 7e02d9fa3bb8..54dc980c1955 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -39,6 +39,7 @@
#include <svl/stritem.hxx>
#include <svl/whiter.hxx>
#include <vcl/msgbox.hxx>
+#include <sfx2/objface.hxx>
#include <svx/svxdlg.hxx>
#include <editeng/colritem.hxx>
@@ -59,6 +60,7 @@
#include "tabbgcolor.hxx"
#include "tabbgcolordlg.hxx"
+#include "sccommands.h"
using ::boost::scoped_ptr;
using namespace com::sun::star;
@@ -419,26 +421,23 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
String aErrMsg ( ScGlobal::GetRscString( STR_INVALIDTABNAME ) );
String aName;
String aDlgTitle;
+ const sal_Char* pHelpId = 0;
switch ( nSlot )
{
case FID_TAB_APPEND:
aDlgTitle = String(ScResId(SCSTR_APDTABLE));
pDoc->CreateValidTabName( aName );
+ pHelpId = HID_SC_APPEND_NAME;
break;
case FID_TAB_RENAME:
aDlgTitle = String(ScResId(SCSTR_RENAMETAB));
pDoc->GetName( pViewData->GetTabNo(), aName );
+ pHelpId = HID_SC_RENAME_NAME;
break;
}
-//CHINA001 ScStringInputDlg* pDlg =
-//CHINA001 new ScStringInputDlg( GetDialogParent(),
-//CHINA001 aDlgTitle,
-//CHINA001 String(ScResId(SCSTR_NAME)),
-//CHINA001 aName,
-//CHINA001 nSlot );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
@@ -446,7 +445,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
aDlgTitle,
String(ScResId(SCSTR_NAME)),
aName,
- nSlot,RID_SCDLG_STRINPUT);
+ GetStaticInterface()->GetSlot(nSlot)->GetCommand(), pHelpId, RID_SCDLG_STRINPUT);
DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
while ( !bDone && nRet == RET_OK )
@@ -755,7 +754,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
String(ScResId(SCSTR_SET_TAB_BG_COLOR)),
String(ScResId(SCSTR_NO_TAB_BG_COLOR)),
aTabBgColor,
- nSlot,RID_SCDLG_TAB_BG_COLOR);
+ CMD_FID_TAB_SET_TAB_BG_COLOR,
+ RID_SCDLG_TAB_BG_COLOR);
while ( !bDone && nRet == RET_OK )
{
nRet = pDlg->Execute();