Kaydet (Commit) b4f43007 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

allow ref edit fields that are not direct children of the ScAnyRefDlg

Change-Id: I966b67b9f62a8c1c3b9dc3394befe48358cbd34e
üst 7d122d0c
...@@ -70,6 +70,7 @@ class ScFormulaReferenceHelper ...@@ -70,6 +70,7 @@ class ScFormulaReferenceHelper
Point aOldEditPos; // Original position of the input field Point aOldEditPos; // Original position of the input field
Size aOldEditSize; // Original size of the input field Size aOldEditSize; // Original size of the input field
Point aOldButtonPos; // Original position of the button Point aOldButtonPos; // Original position of the button
Window* mpOldEditParent; // Original parent of the edit field and the button
sal_Bool bEnableColorRef; sal_Bool bEnableColorRef;
sal_Bool bHighLightRef; sal_Bool bHighLightRef;
......
...@@ -60,6 +60,7 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi ...@@ -60,6 +60,7 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi
, pAccel( NULL ) , pAccel( NULL )
, pHiddenMarks(NULL) , pHiddenMarks(NULL)
, nRefTab(0) , nRefTab(0)
, mpOldEditParent( NULL )
, bHighLightRef( false ) , bHighLightRef( false )
, bAccInserted( false ) , bAccInserted( false )
{ {
...@@ -365,6 +366,9 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) ...@@ -365,6 +366,9 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced )
bAccInserted = false; bAccInserted = false;
} }
// restore the parent of the edit field
pRefEdit->SetParent(mpOldEditParent);
// Fenstertitel anpassen // Fenstertitel anpassen
m_pWindow->SetText(sOldDialogText); m_pWindow->SetText(sOldDialogText);
...@@ -377,6 +381,7 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) ...@@ -377,6 +381,7 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced )
// set button position and image // set button position and image
if( pRefBtn ) if( pRefBtn )
{ {
pRefBtn->SetParent(m_pWindow);
pRefBtn->SetPosPixel( aOldButtonPos ); pRefBtn->SetPosPixel( aOldButtonPos );
pRefBtn->SetStartImage(); pRefBtn->SetStartImage();
} }
...@@ -408,6 +413,19 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: ...@@ -408,6 +413,19 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
sNewDialogText = sOldDialogText; sNewDialogText = sOldDialogText;
sNewDialogText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); 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 // Alle Elemente ausser EditCell und Button verstecken
sal_uInt16 nChildren = m_pWindow->GetChildCount(); sal_uInt16 nChildren = m_pWindow->GetChildCount();
pHiddenMarks = new sal_Bool [nChildren]; pHiddenMarks = new sal_Bool [nChildren];
...@@ -429,13 +447,6 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: ...@@ -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 // Edit-Feld verschieben und anpassen
Size aNewDlgSize(aOldDialogSize.Width(), aOldEditSize.Height()); Size aNewDlgSize(aOldDialogSize.Width(), aOldEditSize.Height());
Size aNewEditSize(aNewDlgSize); Size aNewEditSize(aNewDlgSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment