diff options
author | Skyler Grey <skyler.grey@collabora.com> | 2023-10-20 09:02:57 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-10-27 08:07:21 +0200 |
commit | 4bb1a7836abb49a9b0513958239f3998305201fd (patch) | |
tree | 5966014878733f6cc724b03c14b1635e51d2c4c9 | |
parent | 8ad82fc115a337604c064d37adfffcc81440248e (diff) |
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/+/158349
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/reffld.hxx | 27 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter7.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/reffld.cxx | 99 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 37 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/fldui/fldmgr.cxx | 21 | ||||
-rw-r--r-- | sw/source/uibase/inc/wrtsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/move.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/fldrefpage.ui | 231 |
16 files changed, 303 insertions, 160 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 233edb71c240..fd28607c5e32 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -702,7 +702,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 7ccf7477bd6e..5ef7dc664765 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -779,14 +779,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(""); @@ -794,7 +796,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()); @@ -1034,7 +1037,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 @@ -1047,7 +1050,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 @@ -1061,7 +1064,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 93d22362745c..05ea83bfad70 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 442e1644a753..96b9716f7eac 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 ); } @@ -424,6 +425,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.data(), charactersToKeep.size()); + else + rText = OUString(); +} + // #i85090# OUString SwGetRefField::GetExpandedTextOfReferencedTextNode( SwRootFrame const& rLayout, SwTextNode* pTextNode, SwFrame* pFrame) const @@ -442,6 +467,9 @@ OUString SwGetRefField::GetExpandedTextOfReferencedTextNode( sRet = sw::GetExpandTextMerged(&rLayout, *pReferencedTextNode, true, false, ExpandMode(0)); sRet = lcl_formatStringByCombiningCharacter( sRet, cStrikethrough ); } + + StylerefStripNonnumerical(sRet); + return sRet; } @@ -524,7 +552,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? @@ -785,6 +813,8 @@ void SwGetRefField::UpdateField(const SwTextField* pFieldTextAttr, SwFrame* pFra default: OSL_FAIL("<SwGetRefField::UpdateField(..)> - unknown format type"); } + + StylerefStripNonnumerical(rText); } // #i81002# @@ -880,7 +910,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()); @@ -1217,8 +1247,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?" ); @@ -1337,6 +1367,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; @@ -1434,9 +1466,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; @@ -1450,21 +1482,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); @@ -1474,14 +1512,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; @@ -1497,14 +1535,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; } @@ -1515,8 +1553,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; @@ -1524,22 +1562,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; @@ -1547,7 +1588,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; @@ -1555,14 +1596,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 f9702e28b19a..decdd4215f0b 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -2405,7 +2405,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe // 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 749678ec6b32..b5d423e8fd42 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1498,6 +1498,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 c51f8a1256ab..f041e7ac1fad 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2183,7 +2183,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) { @@ -2238,14 +2238,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); @@ -2318,7 +2318,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 61083223eb3f..feab4e976385 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 3b69fb63739d..9187afa08832 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1119,7 +1119,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)) @@ -1135,7 +1141,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; } @@ -1668,10 +1674,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 da8214329486..741c28c8a648 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -494,7 +494,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 6bcabdd4292d..d7fbf8c2674a 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1314,7 +1314,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 c50740354928..cda2b32112ce 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -708,10 +708,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 f4881304f95c..3bf614370b97 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -475,7 +475,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 78fc930eb6f3..549a7a6e6f9a 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,22 +127,22 @@ <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> @@ -177,9 +176,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"/> @@ -188,40 +187,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> @@ -236,22 +279,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> @@ -264,36 +307,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> @@ -324,21 +367,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> @@ -370,9 +413,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"/> @@ -387,35 +430,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"> @@ -424,30 +467,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"> @@ -456,8 +499,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> @@ -469,8 +512,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> |