/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** * FormFields are inline text objects that are only found in MS Word. * They cannot be created in Excel or in Calc. * * There are three specific kinds of FormFields: CheckBox, DropDown, and TextInput.
*/
SwVbaFormField::SwVbaFormField(const uno::Reference<ooo::vba::XHelperInterface>& rParent, const uno::Reference<uno::XComponentContext>& rContext, const rtl::Reference<SwXTextDocument>& xTextDocument,
sw::mark::Fieldmark& rFormField)
: SwVbaFormField_BASE(rParent, rContext)
, m_xTextDocument(xTextDocument)
, m_rFormField(rFormField)
{
}
SwVbaFormField::~SwVbaFormField() {}
uno::Any SwVbaFormField::CheckBox()
{ return uno::Any(uno::Reference<word::XCheckBox>( new SwVbaFormFieldCheckBox(mxParent, mxContext, m_rFormField)));
}
uno::Any SwVbaFormField::DropDown()
{ return uno::Any(uno::Reference<word::XDropDown>( new SwVbaFormFieldDropDown(mxParent, mxContext, m_rFormField)));
}
uno::Any SwVbaFormField::TextInput()
{ return uno::Any(uno::Reference<word::XTextInput>( new SwVbaFormFieldTextInput(mxParent, mxContext, m_rFormField)));
}
// DateFields are a LO specialty, and do not exist natively in MS documents. Ignore if added... auto pDateField = dynamic_cast<sw::mark::DateFieldmark*>(pFieldMark); while (pDateField)
{
pFieldMark = pMarkAccess->getFieldmarkBefore(pDateField->GetMarkPos(), /*bLoop=*/false);
pDateField = dynamic_cast<sw::mark::DateFieldmark*>(pFieldMark);
}
if (!pFieldMark) return uno::Any();
return uno::Any(uno::Reference<word::XFormField>( new SwVbaFormField(mxParent, mxContext, m_xTextDocument, *pFieldMark)));
}
// DateFields are a LO specialty, and do not exist natively in MS documents. Ignore if added... auto pDateField = dynamic_cast<sw::mark::DateFieldmark*>(pFieldMark); while (pDateField)
{
pFieldMark = pMarkAccess->getFieldmarkAfter(pDateField->GetMarkPos(), /*bLoop=*/false);
pDateField = dynamic_cast<sw::mark::DateFieldmark*>(pFieldMark);
}
if (!pFieldMark) return uno::Any();
return uno::Any(uno::Reference<word::XFormField>( new SwVbaFormField(mxParent, mxContext, m_xTextDocument, *pFieldMark)));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.