summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-10-11 03:48:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-10-11 04:39:27 +0200
commitb4f430074cfce0bda32dddfb4d0251ea5aec83ab (patch)
tree6481ec37a532d53f29eb51f84be9b5bda9945c28 /sc
parent7d122d0cef4ecdeea0d11e619ec77aa7431344d9 (diff)
allow ref edit fields that are not direct children of the ScAnyRefDlg
Change-Id: I966b67b9f62a8c1c3b9dc3394befe48358cbd34e
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx1
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx25
2 files changed, 19 insertions, 7 deletions
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 7aa3207c5eb7..247edc018a24 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -70,6 +70,7 @@ class ScFormulaReferenceHelper
Point aOldEditPos; // Original position of the input field
Size aOldEditSize; // Original size of the input field
Point aOldButtonPos; // Original position of the button
+ Window* mpOldEditParent; // Original parent of the edit field and the button
sal_Bool bEnableColorRef;
sal_Bool bHighLightRef;
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 99136b9379be..fa4382304493 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -60,6 +60,7 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi
, pAccel( NULL )
, pHiddenMarks(NULL)
, nRefTab(0)
+ , mpOldEditParent( NULL )
, bHighLightRef( false )
, bAccInserted( false )
{
@@ -365,6 +366,9 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced )
bAccInserted = false;
}
+ // restore the parent of the edit field
+ pRefEdit->SetParent(mpOldEditParent);
+
// Fenstertitel anpassen
m_pWindow->SetText(sOldDialogText);
@@ -377,6 +381,7 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced )
// set button position and image
if( pRefBtn )
{
+ pRefBtn->SetParent(m_pWindow);
pRefBtn->SetPosPixel( aOldButtonPos );
pRefBtn->SetStartImage();
}
@@ -408,6 +413,19 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
sNewDialogText = sOldDialogText;
sNewDialogText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
+ mpOldEditParent = pRefEdit->GetParent();
+
+ // Alte Daten merken
+ aOldDialogSize = m_pWindow->GetOutputSizePixel();
+ aOldEditPos = pRefEdit->GetPosPixel();
+ aOldEditSize = pRefEdit->GetSizePixel();
+ if (pRefBtn)
+ aOldButtonPos = pRefBtn->GetPosPixel();
+
+ pRefEdit->SetParent(m_pWindow);
+ if(pRefBtn)
+ pRefBtn->SetParent(m_pWindow);
+
// Alle Elemente ausser EditCell und Button verstecken
sal_uInt16 nChildren = m_pWindow->GetChildCount();
pHiddenMarks = new sal_Bool [nChildren];
@@ -429,13 +447,6 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
}
}
- // Alte Daten merken
- aOldDialogSize = m_pWindow->GetOutputSizePixel();
- aOldEditPos = pRefEdit->GetPosPixel();
- aOldEditSize = pRefEdit->GetSizePixel();
- if (pRefBtn)
- aOldButtonPos = pRefBtn->GetPosPixel();
-
// Edit-Feld verschieben und anpassen
Size aNewDlgSize(aOldDialogSize.Width(), aOldEditSize.Height());
Size aNewEditSize(aNewDlgSize);