sw/inc/crsrsh.hxx | 2 sw/inc/reffld.hxx | 27 ++ sw/qa/extras/uiwriter/uiwriter7.cxx | 15 - sw/source/core/crsr/crstrvl.cxx | 4 sw/source/core/fields/reffld.cxx | 99 +++++++-- sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 sw/source/core/unocore/unofield.cxx | 1 sw/source/filter/ww8/ww8par5.cxx | 8 sw/source/ui/fldui/fldref.cxx | 37 ++- sw/source/ui/fldui/fldref.hxx | 4 sw/source/uibase/fldui/fldmgr.cxx | 21 +- sw/source/uibase/inc/wrtsh.hxx | 2 sw/source/uibase/shells/textsh1.cxx | 3 sw/source/uibase/wrtsh/move.cxx | 4 sw/source/uibase/wrtsh/wrtsh2.cxx | 3 sw/uiconfig/swriter/ui/fldrefpage.ui | 239 ++++++++++++++---------- 16 files changed, 307 insertions(+), 164 deletions(-)
New commits: commit ff93cd6c71c5fdf7a89948bad79dc8d19a39f903 Author: Skyler Grey <skyler.g...@collabora.com> AuthorDate: Fri Oct 20 09:02:57 2023 +0000 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Oct 20 16:51:49 2023 +0200 Add flags to STYLEREF This commit is part of an implementation for the following STYLEREF flags - Search from bottom to top, which sets the STYLEREF field to search downwards first, or from the bottom of the page in marginals - Hide non numerical, which hides all characters that are not either numbers or punctuation commonly used as delimiters. For example, if your STYLEREF said "Chapter 2.1", this setting would make it say "2.1" This commit implements: - The document model - The layout - The UI Change-Id: I7d8f455ffe90cface4f3b1acf6b9bef6a045ed19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158233 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 639b29f3ed98..4694ae9ca578 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -698,7 +698,7 @@ public: bool SelectNxtPrvHyperlink( bool bNext ); bool GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType, - sal_uInt16 nSeqNo ); + sal_uInt16 nSeqNo, sal_uInt16 nFlags ); // get the nth character from the start or end of the current selection sal_Unicode GetChar( bool bEnd = true, tools::Long nOffset = 0 ); diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index bf9d563ab2ac..293b913c406b 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -34,6 +34,20 @@ class SwFrame; bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos, const SwTextNode& rBehindNd, sal_Int32 nSttPos ); +#define REFFLDFLAG 0x4000 +#define REFFLDFLAG_BOOKMARK 0x4800 +#define REFFLDFLAG_FOOTNOTE 0x5000 +#define REFFLDFLAG_ENDNOTE 0x6000 +// #i83479# +#define REFFLDFLAG_HEADING 0x7100 +#define REFFLDFLAG_NUMITEM 0x7200 + +#define REFFLDFLAG_STYLE 0xc000 +/* we skip past 0x8000, 0x9000, 0xa000 and 0xb000 as when we bitwise 'and' + with REFFLDFLAG they are false */ +#define REFFLDFLAG_STYLE_FROM_BOTTOM 0xc100 +#define REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL 0xc200 + enum REFERENCESUBTYPE { REF_SETREFATTR = 0, @@ -81,7 +95,7 @@ public: void MergeWithOtherDoc( SwDoc& rDestDoc ); static SwTextNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark, - sal_uInt16 nSubType, sal_uInt16 nSeqNo, + sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, sal_Int32* pStt, sal_Int32* pEnd = nullptr, SwRootFrame const* pLayout = nullptr, SwTextNode* pSelf = nullptr, SwFrame* pFrame = nullptr); @@ -98,13 +112,18 @@ private: sal_uInt16 m_nSubType; /// reference to either a SwTextFootnote::m_nSeqNo or a SwSetExpField::mnSeqNo sal_uInt16 m_nSeqNo; + sal_uInt16 m_nFlags; virtual OUString ExpandImpl(SwRootFrame const* pLayout) const override; virtual std::unique_ptr<SwField> Copy() const override; + /// Strip out text that is not either a number or a delimiter. Used in STYLEREF for when you + /// have chapters labelled "Chapter X.Y" and want to just keep the "X.Y". Distinct from + /// GetExpandedTextOfReferencedTextNode so you can run it after any other processing + void StylerefStripNonnumerical(OUString& rText) const; public: SwGetRefField( SwGetRefFieldType*, OUString aSetRef, OUString aReferenceLanguage, - sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uLong nFormat ); + sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, sal_uLong nFormat ); virtual ~SwGetRefField() override; @@ -140,6 +159,10 @@ public: sal_uInt16 GetSeqNo() const { return m_nSeqNo; } void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; } + /// Get/set flags (currently only used for REF_STYLE) + sal_uInt16 GetFlags() const { return m_nFlags; } + void SetFlags( sal_uInt16 n ) { m_nFlags = n; } + // Name of reference. virtual OUString GetPar1() const override; virtual void SetPar1(const OUString& rStr) override; diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 697a9defa63c..e3a2783b3029 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -780,14 +780,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) //moving cursor to the starting of document pWrtShell->StartOfSection(); //inserting reference field 1 - SwGetRefField aField1(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(0), REF_CONTENT); + SwGetRefField aField1(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(0), sal_uInt16(0), + REF_CONTENT); pWrtShell->InsertField2(aField1); //inserting second footnote pWrtShell->InsertFootnote(""); pWrtShell->StartOfSection(); pCursor->Move(fnMoveForward); //inserting reference field 2 - SwGetRefField aField2(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(1), REF_CONTENT); + SwGetRefField aField2(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(1), sal_uInt16(0), + REF_CONTENT); pWrtShell->InsertField2(aField2); //inserting third footnote pWrtShell->InsertFootnote(""); @@ -795,7 +797,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); pCursor->Move(fnMoveForward); //inserting reference field 3 - SwGetRefField aField3(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(2), REF_CONTENT); + SwGetRefField aField3(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(2), sal_uInt16(0), + REF_CONTENT); pWrtShell->InsertField2(aField3); //updating the fields IDocumentFieldsAccess& rField(pDoc->getIDocumentFieldsAccess()); @@ -1035,7 +1038,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) pWrtShell->StartOfSection(); //inserting reference field 1 SwGetRefField aGetField1(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(0), - REF_CONTENT); + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField1); //now we have ref1-seq1 //moving the cursor @@ -1048,7 +1051,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) pCursor->Move(fnMoveForward); //inserting reference field 2 SwGetRefField aGetField2(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(1), - REF_CONTENT); + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField2); //now we have ref1-ref2-seq1-seq2 //moving the cursor @@ -1062,7 +1065,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) pCursor->Move(fnMoveForward); //inserting reference field 3 SwGetRefField aGetField3(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(2), - REF_CONTENT); + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField3); //now after insertion we have ref1-ref2-ref3-seq1-seq2-seq3 //updating the fields diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 3326648b3a5a..b5a7690ae130 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1402,7 +1402,7 @@ void SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineN /// jump to reference marker bool SwCursorShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType, - sal_uInt16 nSeqNo ) + sal_uInt16 nSeqNo, sal_uInt16 nFlags ) { CurrShell aCurr( this ); SwCallLink aLk( *this ); // watch Cursor-Moves @@ -1416,7 +1416,7 @@ bool SwCursorShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType, SwContentFrame* pRefFrame = GetCurrFrame(); SwTextNode* pTextNd = SwGetRefFieldType::FindAnchor(GetDoc(), rRefMark, - nSubType, nSeqNo, &nPos, nullptr, GetLayout(), pRefTextNd, pRefFrame); + nSubType, nSeqNo, nFlags, &nPos, nullptr, GetLayout(), pRefTextNd, pRefFrame); if( !pTextNd || !pTextNd->GetNodes().IsDocNodes() ) return false; diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 7c47846fc5ff..d7e2e6ff75fd 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -350,12 +350,13 @@ static void lcl_formatReferenceLanguage( OUString& rRefText, /// get references SwGetRefField::SwGetRefField( SwGetRefFieldType* pFieldType, OUString aSetRef, OUString aSetReferenceLanguage, sal_uInt16 nSubTyp, - sal_uInt16 nSequenceNo, sal_uLong nFormat ) + sal_uInt16 nSequenceNo, sal_uInt16 nFlags, sal_uLong nFormat ) : SwField(pFieldType, nFormat), m_sSetRefName(std::move(aSetRef)), m_sSetReferenceLanguage(std::move(aSetReferenceLanguage)), m_nSubType(nSubTyp), - m_nSeqNo(nSequenceNo) + m_nSeqNo(nSequenceNo), + m_nFlags(nFlags) { } @@ -409,7 +410,7 @@ const SwTextNode* SwGetRefField::GetReferencedTextNode(SwTextNode* pTextNode, Sw if (!pTyp) return nullptr; sal_Int32 nDummy = -1; - return SwGetRefFieldType::FindAnchor( &pTyp->GetDoc(), m_sSetRefName, m_nSubType, m_nSeqNo, &nDummy, + return SwGetRefFieldType::FindAnchor( &pTyp->GetDoc(), m_sSetRefName, m_nSubType, m_nSeqNo, m_nFlags, &nDummy, nullptr, nullptr, pTextNode, pFrame ); } @@ -425,6 +426,30 @@ static OUString lcl_formatStringByCombiningCharacter(std::u16string_view sText, return sRet.makeStringAndClear(); } +void SwGetRefField::StylerefStripNonnumerical(OUString& rText) const +{ + // for STYLEREF, hide text that is neither a delimiter nor a number if that flag is set + if ( m_nSubType != REF_STYLE || (GetFlags() & REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL) != REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL ) + return; + + std::vector<sal_Unicode> charactersToKeep; + + for (int i = 0; i < rText.getLength(); i++) { + auto character = rText[i]; + + if ( + (character >= '(' && character <= '@') || // includes 0-9 and most of the punctuation we want + (character >= '[' && character <= '_') // includes the rest of the punctuation we want + ) + charactersToKeep.push_back(character); + } + + if (charactersToKeep.size()) + rText = OUString(&charactersToKeep[0], charactersToKeep.size()); + else + rText = OUString(); +} + // #i85090# OUString SwGetRefField::GetExpandedTextOfReferencedTextNode( SwRootFrame const& rLayout, SwTextNode* pTextNode, SwFrame* pFrame) const @@ -443,6 +468,9 @@ OUString SwGetRefField::GetExpandedTextOfReferencedTextNode( sRet = sw::GetExpandTextMerged(&rLayout, *pReferencedTextNode, true, false, ExpandMode(0)); sRet = lcl_formatStringByCombiningCharacter( sRet, cStrikethrough ); } + + StylerefStripNonnumerical(sRet); + return sRet; } @@ -525,7 +553,7 @@ void SwGetRefField::UpdateField(const SwTextField* pFieldTextAttr, SwFrame* pFra sal_Int32 nNumStart = -1; sal_Int32 nNumEnd = -1; SwTextNode* pTextNd = SwGetRefFieldType::FindAnchor( - &rDoc, m_sSetRefName, m_nSubType, m_nSeqNo, &nNumStart, &nNumEnd, + &rDoc, m_sSetRefName, m_nSubType, m_nSeqNo, m_nFlags, &nNumStart, &nNumEnd, pLayout, pFieldTextAttr ? pFieldTextAttr->GetpTextNode() : nullptr, pFrameContainingField ); // not found? @@ -786,6 +814,8 @@ void SwGetRefField::UpdateField(const SwTextField* pFieldTextAttr, SwFrame* pFra default: OSL_FAIL("<SwGetRefField::UpdateField(..)> - unknown format type"); } + + StylerefStripNonnumerical(rText); } // #i81002# @@ -881,7 +911,7 @@ std::unique_ptr<SwField> SwGetRefField::Copy() const { std::unique_ptr<SwGetRefField> pField( new SwGetRefField( static_cast<SwGetRefFieldType*>(GetTyp()), m_sSetRefName, m_sSetReferenceLanguage, m_nSubType, - m_nSeqNo, GetFormat() ) ); + m_nSeqNo, m_nFlags, GetFormat() ) ); pField->m_sText = m_sText; pField->m_sTextRLHidden = m_sTextRLHidden; return std::unique_ptr<SwField>(pField.release()); @@ -1218,8 +1248,8 @@ namespace } SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, - sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_Int32* pStt, - sal_Int32* pEnd, SwRootFrame const* const pLayout, + sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, + sal_Int32* pStt, sal_Int32* pEnd, SwRootFrame const* const pLayout, SwTextNode* pSelf, SwFrame* pContentFrame) { OSL_ENSURE( pStt, "Why did no one check the StartPos?" ); @@ -1338,6 +1368,8 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, case REF_STYLE: if (!pSelf) break; + bool bFlagFromBottom = (nFlags & REFFLDFLAG_STYLE_FROM_BOTTOM) == REFFLDFLAG_STYLE_FROM_BOTTOM; + const SwNodes& nodes = pDoc->GetNodes(); StyleRefElementType elementType = StyleRefElementType::Default; @@ -1435,9 +1467,9 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, pPageEnd = pReference; } - std::deque<SwNode*> pAbovePage; - std::deque<SwNode*> pInPage; - std::deque<SwNode*> pBelowPage; + std::deque<SwNode*> pSearchSecond; + std::deque<SwNode*> pInPage; /* or pSearchFirst */ + std::deque<SwNode*> pSearchThird; bool beforeStart = true; bool beforeEnd = true; @@ -1451,21 +1483,27 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, if (beforeStart) { - pAbovePage.push_front(nodes[n]); + if (bFlagFromBottom) + pSearchThird.push_front(nodes[n]); + else + pSearchSecond.push_front(nodes[n]); } else if (beforeEnd) { - pInPage.push_back(nodes[n]); + if (bFlagFromBottom) + pInPage.push_front(nodes[n]); + else + pInPage.push_back(nodes[n]); if (*pPageEnd == *nodes[n]) { beforeEnd = false; } } + else if (bFlagFromBottom) + pSearchSecond.push_back(nodes[n]); else - { - pBelowPage.push_back(nodes[n]); - } + pSearchThird.push_back(nodes[n]); } pTextNd = SearchForStyleAnchor(pSelf, pInPage, rRefMark); @@ -1475,14 +1513,14 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, } // 2. Search up from the top of the page - pTextNd = SearchForStyleAnchor(pSelf, pAbovePage, rRefMark); + pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, rRefMark); if (pTextNd) { break; } // 3. Search down from the bottom of the page - pTextNd = SearchForStyleAnchor(pSelf, pBelowPage, rRefMark); + pTextNd = SearchForStyleAnchor(pSelf, pSearchThird, rRefMark); if (pTextNd) { break; @@ -1498,14 +1536,14 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, break; } - pTextNd = SearchForStyleAnchor(pSelf, pAbovePage, rRefMark, + pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, rRefMark, false /* bCaseSensitive */); if (pTextNd) { break; } - pTextNd = SearchForStyleAnchor(pSelf, pBelowPage, rRefMark, + pTextNd = SearchForStyleAnchor(pSelf, pSearchThird, rRefMark, false /* bCaseSensitive */); break; } @@ -1516,8 +1554,8 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, // For references, styleref acts from the position of the reference not the field // Happily, the previous code saves either one into pReference, so the following is generic for both - std::deque<SwNode*> pNotBelowElement; - std::deque<SwNode*> pBelowElement; + std::deque<SwNode*> pSearchFirst; + std::deque<SwNode*> pSearchSecond; bool beforeElement = true; @@ -1525,22 +1563,25 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, { if (beforeElement) { - pNotBelowElement.push_front(nodes[n]); + if (bFlagFromBottom) + pSearchSecond.push_front(nodes[n]); + else + pSearchFirst.push_front(nodes[n]); if (*pReference == *nodes[n]) { beforeElement = false; } } + else if (bFlagFromBottom) + pSearchFirst.push_back(nodes[n]); else - { - pBelowElement.push_back(nodes[n]); - } + pSearchSecond.push_back(nodes[n]); } // 1. Search up until we hit the top of the document - pTextNd = SearchForStyleAnchor(pSelf, pNotBelowElement, rRefMark); + pTextNd = SearchForStyleAnchor(pSelf, pSearchFirst, rRefMark); if (pTextNd) { break; @@ -1548,7 +1589,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, // 2. Search down until we hit the bottom of the document - pTextNd = SearchForStyleAnchor(pSelf, pBelowElement, rRefMark); + pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, rRefMark); if (pTextNd) { break; @@ -1556,14 +1597,14 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, // Again, we need to remember that Word styles are not case sensitive - pTextNd = SearchForStyleAnchor(pSelf, pNotBelowElement, rRefMark, + pTextNd = SearchForStyleAnchor(pSelf, pSearchFirst, rRefMark, false /* bCaseSensitive */); if (pTextNd) { break; } - pTextNd = SearchForStyleAnchor(pSelf, pBelowElement, rRefMark, + pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, rRefMark, false /* bCaseSensitive */); break; } diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 77cb90dd3d5a..1400b54cc1ab 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -2030,7 +2030,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // Destination Rectangle const SwGetRefField* pField = static_cast<SwGetRefField*>(pFormatField->GetField()); const OUString& rRefName = pField->GetSetRefName(); - mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() ); + mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo(), pField->GetFlags() ); const SwRect& rDestRect = mrSh.GetCharRect(); const SwPageFrame* pCurrPage = static_cast<const SwPageFrame*>( mrSh.GetLayout()->Lower() ); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index f1818c3c088f..5e74c3434190 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1529,6 +1529,7 @@ void SAL_CALL SwXTextField::attach( m_pImpl->m_pProps->sPar4, 0, 0, + 0, 0)); if (!m_pImpl->m_pProps->sPar3.isEmpty()) static_cast<SwGetRefField*>(xField.get())->SetExpand(m_pImpl->m_pProps->sPar3); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index fbea8790ad96..0f8e9753ac11 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2157,7 +2157,7 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, OUString& rStr ) SwGetRefField aField( static_cast<SwGetRefFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), - sBkmName,"",REF_BOOKMARK,0,eFormat); + sBkmName,"",REF_BOOKMARK,0,0,eFormat); if (eFormat == REF_CONTENT) { @@ -2212,14 +2212,14 @@ eF_ResT SwWW8ImplReader::Read_F_NoteReference( WW8FieldDesc*, OUString& rStr ) // set Sequence No of corresponding Foot-/Endnote to Zero // (will be corrected in SwGetRefField aField( static_cast<SwGetRefFieldType*>( - m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), aBkmName, "", REF_FOOTNOTE, 0, + m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), aBkmName, "", REF_FOOTNOTE, 0, 0, REF_ONLYNUMBER ); m_xReffingStck->NewAttr(*m_pPaM->GetPoint(), SwFormatField(aField)); m_xReffingStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_FIELD); if (bAboveBelow) { SwGetRefField aField2( static_cast<SwGetRefFieldType*>( - m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )),aBkmName, "", REF_FOOTNOTE, 0, + m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )),aBkmName, "", REF_FOOTNOTE, 0, 0, REF_UPDOWN ); m_xReffingStck->NewAttr(*m_pPaM->GetPoint(), SwFormatField(aField2)); m_xReffingStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_FIELD); @@ -2292,7 +2292,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr ) sPageRefBookmarkName = sName; } SwGetRefField aField( static_cast<SwGetRefFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), - sPageRefBookmarkName, "", REF_BOOKMARK, 0, REF_PAGE ); + sPageRefBookmarkName, "", REF_BOOKMARK, 0, 0, REF_PAGE ); m_rDoc.getIDocumentContentOperations().InsertPoolItem( *m_pPaM, SwFormatField( aField ) ); return eF_ResT::OK; diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 7d8fda5145af..4eaf2c567bbf 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -40,16 +40,6 @@ #include <o3tl/string_view.hxx> #include <vcl/settings.hxx> -#define REFFLDFLAG 0x4000 -#define REFFLDFLAG_BOOKMARK 0x4800 -#define REFFLDFLAG_FOOTNOTE 0x5000 -#define REFFLDFLAG_ENDNOTE 0x6000 -// #i83479# -#define REFFLDFLAG_HEADING 0x7100 -#define REFFLDFLAG_NUMITEM 0x7200 -#define REFFLDFLAG_STYLE 0xc000 -/* we skip past 0x8000, 0x9000, 0xa000 and 0xb000 as when we bitwise 'and' - with REFFLDFLAG they are false */ static sal_uInt16 nFieldDlgFormatSel = 0; @@ -70,6 +60,9 @@ SwFieldRefPage::SwFieldRefPage(weld::Container* pPage, weld::DialogController* p , m_xNameED(m_xBuilder->weld_entry("name")) , m_xValueED(m_xBuilder->weld_entry("value")) , m_xFilterED(m_xBuilder->weld_entry("filter")) + , m_xStylerefFlags(m_xBuilder->weld_widget("stylerefflagsframe")) + , m_xStylerefFromBottomCB(m_xBuilder->weld_check_button("stylereffrombottomcheckbox")) + , m_xStylerefHideNonNumericalCB(m_xBuilder->weld_check_button("stylerefhidenonnumericalcheckbox")) { m_xSelectionLB->make_sorted(); // #i83479# @@ -293,6 +286,8 @@ void SwFieldRefPage::Reset(const SfxItemSet* ) m_xNameED->save_value(); m_xValueED->save_value(); m_xFilterED->set_text(OUString()); + m_xStylerefFromBottomCB->save_state(); + m_xStylerefHideNonNumericalCB->save_state(); } } @@ -464,6 +459,8 @@ void SwFieldRefPage::SubTypeHdl() { sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32(); + m_xStylerefFlags->set_visible(nTypeId == REFFLDFLAG_STYLE); + switch(nTypeId) { case static_cast<sal_uInt16>(SwFieldTypesEnum::GetRef): @@ -701,8 +698,11 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString) pStyle = stylesheetIterator->Next(); } - if (IsFieldEdit() && pRefField) + if (IsFieldEdit() && pRefField) { sOldSel = pRefField->GetPar1(); + m_xStylerefFromBottomCB->set_active((pRefField->GetFlags() & REFFLDFLAG_STYLE_FROM_BOTTOM) == REFFLDFLAG_STYLE_FROM_BOTTOM); + m_xStylerefHideNonNumericalCB->set_active((pRefField->GetFlags() & REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL) == REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL); + } } else { @@ -1135,6 +1135,17 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* ) aName = m_xSelectionLB->get_text(nEntry); nTypeId = static_cast<sal_uInt16>(SwFieldTypesEnum::GetRef); nSubType = REF_STYLE; + sal_uInt16 nVal = REFFLDFLAG_STYLE; + + if (m_xStylerefFromBottomCB->get_active()) { + nVal |= REFFLDFLAG_STYLE_FROM_BOTTOM; + } + + if (m_xStylerefHideNonNumericalCB->get_active()) { + nVal |= REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL; + } + + aVal = OUString::number(nVal); } else { SAL_WARN("sw.ui", "<SwFieldRefPage::FillItemSet(..)> no entry selected in selection listbox!"); } @@ -1179,7 +1190,9 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* ) m_xValueED->get_value_changed_from_saved() || m_xTypeLB->get_value_changed_from_saved() || m_xSelectionLB->get_value_changed_from_saved() || - m_xFormatLB->get_value_changed_from_saved()) + m_xFormatLB->get_value_changed_from_saved() || + (nSubType == REF_STYLE + && (m_xStylerefFromBottomCB->get_state_changed_from_saved() || m_xStylerefHideNonNumericalCB->get_state_changed_from_saved()))) { InsertField( static_cast<SwFieldTypesEnum>(nTypeId), nSubType, aName, aVal, nFormat ); } diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index 872e6f526bb6..24727e26169a 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -57,6 +57,10 @@ class SwFieldRefPage : public SwFieldPage std::unique_ptr<weld::Entry> m_xValueED; std::unique_ptr<weld::Entry> m_xFilterED; + std::unique_ptr<weld::Widget> m_xStylerefFlags; + std::unique_ptr<weld::CheckButton> m_xStylerefFromBottomCB; + std::unique_ptr<weld::CheckButton> m_xStylerefHideNonNumericalCB; + DECL_LINK(TypeHdl, weld::TreeView&, void); DECL_LINK(SubTypeListBoxHdl, weld::TreeView&, void); DECL_LINK(SubTypeTreeListBoxHdl, weld::TreeView&, void); diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index c36e50a1454c..ed07881eea6a 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1116,7 +1116,13 @@ bool SwFieldMgr::InsertField( { SwGetRefFieldType* pTyp = static_cast<SwGetRefFieldType*>( pCurShell->GetFieldType(0, SwFieldIds::GetRef) ); - sal_uInt16 nSeqNo = o3tl::narrowing<sal_uInt16>(rData.m_sPar2.toInt32()); + + sal_uInt16 nSeqNo = 0; + sal_uInt16 nFlags = 0; + + if (nSubType == REF_STYLE) nFlags = o3tl::narrowing<sal_uInt16>(rData.m_sPar2.toInt32()); + else nSeqNo = o3tl::narrowing<sal_uInt16>(rData.m_sPar2.toInt32()); + OUString sReferenceLanguage; // handle language-variant formats if (nFormatId >= SAL_N_ELEMENTS(FMT_REF_ARY)) @@ -1132,7 +1138,7 @@ bool SwFieldMgr::InsertField( nFormatId %= SAL_N_ELEMENTS(FMT_REF_ARY); } - pField.reset(new SwGetRefField(pTyp, rData.m_sPar1, sReferenceLanguage, nSubType, nSeqNo, nFormatId)); + pField.reset(new SwGetRefField(pTyp, rData.m_sPar1, sReferenceLanguage, nSubType, nSeqNo, nFlags, nFormatId)); bExp = true; break; } @@ -1665,10 +1671,17 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat, case SwFieldTypesEnum::GetRef: { bSetPar2 = false; - static_cast<SwGetRefField*>(pTmpField.get())->SetSubType( o3tl::narrowing<sal_uInt16>(rPar2.toInt32()) ); + sal_Int16 nSubType = o3tl::narrowing<sal_uInt16>(rPar2.toInt32()); + static_cast<SwGetRefField*>(pTmpField.get())->SetSubType( nSubType ); const sal_Int32 nPos = rPar2.indexOf( '|' ); if( nPos>=0 ) - static_cast<SwGetRefField*>(pTmpField.get())->SetSeqNo( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(rPar2.subView( nPos + 1 )))); + switch (nSubType) { + case REF_STYLE: + static_cast<SwGetRefField*>(pTmpField.get())->SetFlags( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(rPar2.subView( nPos + 1 )))); + break; + default: + static_cast<SwGetRefField*>(pTmpField.get())->SetSeqNo( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(rPar2.subView( nPos + 1 )))); + } } break; case SwFieldTypesEnum::Dropdown: diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 736c0ac363ff..47bb11248592 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -492,7 +492,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)(); bool GotoOutline( const OUString& rName ); bool GotoRegion( std::u16string_view rName ); bool GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType = 0, - sal_uInt16 nSeqNo = 0 ); + sal_uInt16 nSeqNo = 0, sal_uInt16 nFlags = 0 ); bool GotoNextTOXBase( const OUString* pName = nullptr); bool GotoTable( const OUString& rName ); void GotoFormatField( const SwFormatField& rField ); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index daad30d0a067..ad9d47f4430f 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1288,7 +1288,8 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.StartAllAction(); rWrtSh.SwCursorShell::GotoRefMark( static_cast<SwGetRefField*>(pField)->GetSetRefName(), static_cast<SwGetRefField*>(pField)->GetSubType(), - static_cast<SwGetRefField*>(pField)->GetSeqNo() ); + static_cast<SwGetRefField*>(pField)->GetSeqNo(), + static_cast<SwGetRefField*>(pField)->GetFlags() ); rWrtSh.EndAllAction(); rReq.Done(); } diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index 83534e4dc896..fd30e1a3ca3b 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -710,10 +710,10 @@ bool SwWrtShell::GotoRegion( std::u16string_view rName ) } bool SwWrtShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType, - sal_uInt16 nSeqNo ) + sal_uInt16 nSeqNo, sal_uInt16 nFlags ) { SwPosition aPos = *GetCursor()->GetPoint(); - bool bRet = SwCursorShell::GotoRefMark(rRefMark, nSubType, nSeqNo); + bool bRet = SwCursorShell::GotoRefMark(rRefMark, nSubType, nSeqNo, nFlags); if (bRet) m_aNavigationMgr.addEntry(aPos); return bRet; diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 1995e7133c4a..1fba957dead9 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -424,7 +424,8 @@ void SwWrtShell::ClickToField(const SwField& rField, bool bExecHyperlinks) StartAllAction(); SwCursorShell::GotoRefMark( static_cast<const SwGetRefField&>(rField).GetSetRefName(), static_cast<const SwGetRefField&>(rField).GetSubType(), - static_cast<const SwGetRefField&>(rField).GetSeqNo() ); + static_cast<const SwGetRefField&>(rField).GetSeqNo(), + static_cast<const SwGetRefField&>(rField).GetFlags() ); EndAllAction(); break; diff --git a/sw/uiconfig/swriter/ui/fldrefpage.ui b/sw/uiconfig/swriter/ui/fldrefpage.ui index e63deb7bea09..635cbb35fb41 100644 --- a/sw/uiconfig/swriter/ui/fldrefpage.ui +++ b/sw/uiconfig/swriter/ui/fldrefpage.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sw"> <requires lib="gtk+" version="3.20"/> <object class="GtkTreeStore" id="liststore1"> @@ -36,54 +36,53 @@ </object> <object class="GtkBox" id="FieldRefPage"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="border_width">6</property> + <property name="border-width">6</property> <property name="spacing">12</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=3 n-rows=1 --> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="column_spacing">12</property> - <property name="column_homogeneous">True</property> + <property name="column-spacing">12</property> + <property name="column-homogeneous">True</property> <child> <object class="GtkBox" id="box2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">12</property> - <property name="homogeneous">True</property> <child> <object class="GtkFrame" id="typeframe"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> + <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> - <property name="margin-top">6</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="type"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="headers_visible">False</property> - <property name="headers_clickable">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection1"/> </child> @@ -109,9 +108,9 @@ <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="fldrefpage|label1">_Type</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> @@ -120,7 +119,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> @@ -128,29 +127,29 @@ <child> <object class="GtkFrame" id="formatframe"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> + <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> - <property name="margin-top">6</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="format"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore2</property> - <property name="headers_visible">False</property> - <property name="headers_clickable">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection2"/> </child> @@ -176,9 +175,9 @@ <child type="label"> <object class="GtkLabel" id="label3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="fldrefpage|label3">_Refer using:</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> @@ -187,40 +186,84 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> + <child> + <object class="GtkBox" id="stylerefflagsframe"> + <property name="can-focus">False</property> + <property name="valign">end</property> + <property name="hexpand">True</property> + <property name="vexpand">False</property> + <property name="orientation">vertical</property> + <property name="baseline-position">top</property> + <child> + <object class="GtkCheckButton" id="stylereffrombottomcheckbox"> + <property name="label" translatable="yes" context="fldrefpage|stylerefflags|label1">Search from bottom to top</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="stylerefhidenonnumericalcheckbox"> + <property name="label" translatable="yes" context="fldrefpage|stylerefflags|label2">Hide non-numerical characters</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack-type">end</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=1 n-rows=2 --> <object class="GtkGrid" id="grid3"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> <child> <object class="GtkBox" id="box3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="margin-start">5</property> <property name="margin-end">5</property> <child> <object class="GtkLabel" id="label4"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="margin-end">5</property> <property name="label" translatable="yes" context="fldrefpage|label4">Selection</property> <attributes> @@ -235,22 +278,22 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkEntry" id="filter"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> <property name="truncate-multiline">True</property> - <property name="placeholder_text" translatable="yes" context="fldrefpage|filter">Filter Selection</property> + <property name="placeholder-text" translatable="yes" context="fldrefpage|filter">Filter Selection</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> </object> @@ -263,36 +306,36 @@ <child> <object class="GtkFrame" id="selectframe"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkBox" id="box4"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> + <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="orientation">vertical</property> - <property name="margin-top">6</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="selecttip"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore3</property> - <property name="headers_visible">False</property> - <property name="headers_clickable">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection3"/> </child> @@ -323,21 +366,21 @@ <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="select"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore4</property> - <property name="headers_visible">False</property> - <property name="headers_clickable">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection4"/> </child> @@ -369,9 +412,9 @@ </child> <child type="label"> <object class="GtkLabel" id="label2"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="fldrefpage|label2">S_election</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> @@ -386,35 +429,35 @@ </packing> </child> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_top">6</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> + <property name="margin-top">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="valueft"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="fldrefpage|valueft">_Value</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">value</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">value</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkEntry" id="value"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="value-atkobject"> @@ -423,30 +466,30 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkLabel" id="nameft"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="fldrefpage|nameft">Na_me</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">name</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">name</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkEntry" id="name"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> <property name="truncate-multiline">True</property> <child internal-child="accessible"> <object class="AtkObject" id="name-atkobject"> @@ -455,8 +498,8 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> </object> @@ -468,8 +511,8 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> <property name="width">2</property> </packing> </child>